we can define a servlet in web.xml and specify the url-pattern, I often specify the url-pattern into "/*"
, but in Spring MVC,it‘s value is "/"
,if I use "/*"
, I even couldn't visit the welcome file,so any one could tell me what the difference between /
and /*
, thank you
Asked
Active
Viewed 339 times
0
2 Answers
2
Please check your welcome file list specified in web.xml. I've faced a similar situation before. When I named my welcome file as index.jsp and had many other additional names (like index.html, etc) mentioned in web.xml. When I removed all of them except index.jsp, it worked. I'm not sure if it would work for you. Please give it a try and post your feedback.

Mohamed Idris
- 442
- 4
- 10
1
As pointed by Mohamed the issue may be elesewhere. Generally speaking
/
means exactlyhttp://localhost/
/*
meanshttp://localhost/<whatever>
the question must be a little bit refined, if you are configuring org.springframework.web.servlet.DispatcherServlet
a typical pattern should be *.do or you cannot access pure html page.

venergiac
- 7,469
- 2
- 48
- 70