tomcat - Spring MVC giving 404 for root -
i have springmvc application using serve json data. of pages decided via angular. have index.jsp need able view @ root of web-inf directory.
because sending through dispatcher request root beingness picked , sent through. since there no controller maps root beingness rejected , throwing 404.
my question how allow pass through of index.jsp without disrupting rest of application?
<servlet> <servlet-name>cr</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/conf/spring-controllers.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>cr</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>
place index.jsp
file within root of webcontext. utilize next filter mapping:
<servlet-mapping> <servlet-name>cr</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
the /
mapping pick requests cannot resolved. acts grab when no other mappings can found.
spring tomcat spring-mvc
No comments:
Post a Comment