![]() |
Spring Framework Controller
I have been playing around with java web programming a lot lately, and am using the Spring Framework MVC to do this. My problem is that when I go to the url http://localhost:8080/Forum/index.html the spring framework calls the controller it is suppose to call, but when I go to http://localhost:8080/Forum/ it won't call the controller, and I can't seem to figure out how I can get it to do that.
Below is my web.xml file: :
Below is my springapp-servlet.xml :
|
Re: Spring Framework Controller
EDIT: Nevermind. Sorry.
Maybe you need to play with the mapping options more. All I can think of. |
Re: Spring Framework Controller
when you call any URL; procedure to locate this resource within the webserver is:
for a URL: <http|https>://<hostname|IP>[:portno]/<ApplicationName>/[Resource] 1: Go to the <ApplicationName>'s web.xml 2: Find the matching servlet-mapping tag with <url-pattern> regex. for URL:/[Resource] Go to the servelet-mapping tag.. and execute the servelet-class tag servelet 3: If there is no Servelet-mapping match then resource not found error is displayed. 4: if URL:/[Resource] is blank it will take each <welcome-file> from <welcome-file-list> is taken and used as URL:/[Resource] and execute the whole thing from 2: skipping the 3rd point. In your second case http://localhost:8080/Forum/ resource is blank and specified welcome-file "index.jsp" is not matching with any servelet-mapping tag's <url-pattern> so... Insted of <url-pattern>*.html</url-pattern> put <url-pattern>*.*</url-pattern> in servelet-mapping tag.. so scope of index.jsp will within the front controller. |
| All times are GMT -5. The time now is 4:07 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC