java - No mapping found for HTTP request with URI [/Spring_mvc_sep13/WEB-INF/Asset.jsp] in DispatcherServlet -
please me solve issue. request going controller class , getting view name failing display jsp error.
i getting following warning on console when url 'http://localhost:8080/spring_mvc_sep13/assetcontroller' typed in browser.
org.springframework.web.servlet.pagenotfound nohandlerfound
warning: no mapping found http request uri [/spring_mvc_sep13/web-inf/asset.jsp] in dispatcherservlet name 'disp'
the web.xml follows
<servlet> <servlet-name>disp</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/dispatcher-beans.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>disp</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>
the dispatcher-beans.xml file follows
<bean id="viewresolver" class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" ><value>/web-inf/</value></property> <property name="suffix" ><value>.jsp</value></property> </bean> <bean id="handlermapping" class="org.springframework.web.servlet.handler.beannameurlhandlermapping"/> <bean name="/assetcontroller" class="org.pradeep.controller.assetcontroller"/> <context:component-scan base-package="org.pradeep.controller"></context:component-scan> <mvc:annotation-driven/>
the controller class follows
package org.pradeep.controller; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import org.springframework.stereotype.controller; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.servlet.modelandview; import org.springframework.web.servlet.mvc.abstractcontroller; @controller @requestmapping("/assetcontroller") public class assetcontroller extends abstractcontroller { @override protected modelandview handlerequestinternal(httpservletrequest arg0, httpservletresponse arg1) throws exception { modelandview mview = new modelandview("asset"); return mview; } }
i using tomcat server 7.0.30, java 1.8 , getting error. jsp not getting compiled. therefore changed server 7.0.68 , solved issue.
Comments
Post a Comment