0

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

venergiac
  • 7,469
  • 2
  • 48
  • 70
Rocky Hu
  • 1,326
  • 4
  • 17
  • 32

2 Answers2

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

  1. / means exactly http://localhost/
  2. /* means http://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