I get this error.
my web.xml has this
<servlet> <servlet-name>springweb</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/web-application-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springweb</servlet-name> <url-pattern>/app/*</url-pattern> </servlet-mapping>
I have this in my web application-config.xml
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> </bean> <bean name="/Scheduling.htm" class="com.web.SchedulingController"/>
my com.web.SchedulingController looks like
package com.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; public class SchedulingController implements Controller{ public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView modelAndView = new ModelAndView("/jsp/Scheduling_main.jsp"); modelAndView.addObject("message","Hello World MVC!!"); return modelAndView; } }
When I find this controller with the URL http: // localhost: 8080 / project1 / app / Scheduling.htm the Scheduling_main.jsp file is displayed, but the images are not displayed correctly. Also js and css file do not get render.
I am accessing images like these
<img src="jquerylib/images/save_32x32.png" title="Save Appointment">
If I change the URL mapping in the servlet definition to * .htm, the images will be displayed in order. Can you indicate where I'm missing.
Here is the complete error message
WARN [PageNotFound] No mapping found for HTTP request with URI [/mavenproject1/app/jquerylib/images/save_32x32.png] in DispatcherServlet with name 'springweb'
Many thanks. Ravi
spring mvc
Ravi
source share