java - 404 page not found in spring mvc example -


i developing spring application, getting 404 page not found.

next

my folder structure this. webcontent-->web-inf-->jsp-->next.jsp

dispatcher-servlet.xml

<?xml version="1.0" encoding="utf-8" ?> <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:p="http://www.springframework.org/schema/p"     xmlns:context="http://www.springframework.org/schema/context"     xmlns:mvc="http://www.springframework.org/schema/mvc"     xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">     <context:component-scan base-package="com.authority.controllers" />     <mvc:annotation-driven />      <bean id="messagesource"         class="org.springframework.context.support.reloadableresourcebundlemessagesource">         <property name="basename" value="classpath:authority" />         <property name="defaultencoding" value="utf-8" />     </bean>      <bean         class="org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter">         <property name="messageconverters">             <list>                 <bean                     class="org.springframework.http.converter.json.mappingjacksonhttpmessageconverter" />             </list>         </property>     </bean>      <bean id="localechangeinterceptor"         class="org.springframework.web.servlet.i18n.localechangeinterceptor">         <property name="paramname" value="lang" />     </bean>      <bean id="localeresolver"         class="org.springframework.web.servlet.i18n.cookielocaleresolver">         <property name="defaultlocale" value="en" />     </bean>      <bean id="handlermapping"         class="org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping">         <property name="interceptors">             <ref bean="localechangeinterceptor" />         </property>     </bean>      <bean id="viewresolver"         class="org.springframework.web.servlet.view.internalresourceviewresolver">         <property name="prefix" value="/web-inf/jsp/" />         <property name="suffix" value=".jsp" />     </bean>  </beans> 

web.xml

<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">  <welcome-file-list>     <welcome-file>index.jsp</welcome-file> </welcome-file-list>    <servlet>     <servlet-name>dispatcher</servlet-name>     <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class>     <load-on-startup>1</load-on-startup>   </servlet>      <servlet-mapping>     <servlet-name>dispatcher</servlet-name>     <url-pattern>*.do</url-pattern>   </servlet-mapping>    <listener>     <listener-class>org.springframework.web.context.contextloaderlistener</listener-class>   </listener>   <context-param>      <param-name>contextconfiglocation</param-name>     <param-value>/web-inf/dispatcher-servlet.xml</param-value>   </context-param> </web-app> 

please me.

thanks in advance

do use controllers?? pages web-inf dir can't displayed directly invoking browser.

you should implement controller return "next", resolved jsp. check this tutorial more details


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -