|
|
No mapping found for from request with URI in dispatcherservlet
Hi guys,
Am a spring newbie, am trying to get a hello world example going but am getting the following error in my tomcat console,
No mapping found for from request with URI in dispatcherservlet
This is my web.xml
lt;welcome-file-listgt;
lt;welcome-filegt;index.htmllt;/welcome-filegt;
lt;/welcome-file-listgt;
lt;servletgt;
lt;servlet-namegt;springlt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherSe rvletlt;/servlet-classgt;
lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;
lt;servlet-mappinggt;
lt;servlet-namegt;springlt;/servlet-namegt;
lt;ucl-patterngt;/lt;/ucl-patterngt;
lt;/servlet-mappinggt;
This is my spring-servlet.xml
lt;bean id=quot;jspViewResolverquot;
class=quot;org..web.servlet.view.Intern alResourceViewResolverquot;gt;
lt;property name=quot;viewClassquot;
value=quot;org..web.servlet.view.JstlVi ewquot; /gt;
lt;property name=quot;prefixquot; value=quot;/WEB-INF/jsp/quot; /gt;
lt;property name=quot;suffixquot; value=quot;.jspquot; /gt;
lt;/beangt;
Now what I want to achieve is when I type in AppName the app go to index.html, which is located in /WEB-INF/index.html
But when I go AppName/Home.html, the app should go to home.jsp, which is located in /WEB-INF/jsp/home.jsp
Can somebody here please clear my doubt.
Thanks.
Do both ucls result in a 404?
First, welcome file list entries are relative to the web application root so the associated file can't be located in WEB-INF (you could use an empty html file with a redirect). The 2nd ucl should resolve to a JSP /WEB-INF/jsp/Home.jsp (I think Spring is case-sensitive by default but I'm not sure), doesn't it?
(with AppName you mean the context root of the web app right?)
Robin. |
|