Java org.springframework.web.servlet.PageNotFound-未找到具有URI的HTTP请求的映射

Java org.springframework.web.servlet.PageNotFound-未找到具有URI的HTTP请求的映射,java,spring,Java,Spring,大家好,我正在忙着开发一个使用HibernateSpringJSP的简单演示 但是当我想在page index.jsp中转到gererArticle.jsp时 错误就在我眼前 709896[http-8080-1]WARN org.springframework.web.servlet.PageNotFound-在名为“example”的DispatcherServlet中找不到URI为[/exampleAchRef/GererArticle.html]的http请求的映射 这是web.xml

大家好,我正在忙着开发一个使用HibernateSpringJSP的简单演示 但是当我想在page index.jsp中转到gererArticle.jsp时 错误就在我眼前

709896[http-8080-1]WARN org.springframework.web.servlet.PageNotFound-在名为“example”的DispatcherServlet中找不到URI为[/exampleAchRef/GererArticle.html]的http请求的映射

这是web.xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">



<context-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>/WEB-INF/hibernateDataAccessContext.xml /WEB-INF/applicationContext.xml</param-value>
 </context-param>



 <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/classes/log4j.properties</param-value>
  </context-param>



  <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>

  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>





  <!-- Register a servlet that despatches requests to registered controllers  -->
  <servlet>
    <servlet-name>exemple</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>


  <!--  Send all .html files to the Spring dispatcher servlet -->


  <servlet-mapping>
    <servlet-name>exemple</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>





  <!-- Define the web application entry point -->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

</web-app>

上下文配置位置
/WEB-INF/HibernateAtaAccessContext.xml/WEB-INF/applicationContext.xml
log4jConfigLocation
/WEB-INF/classes/log4j.properties
org.springframework.web.util.Log4jConfigListener
org.springframework.web.context.ContextLoaderListener
例
org.springframework.web.servlet.DispatcherServlet
1.
例
*.html
index.jsp
这个application.xml

  <?xml version="1.0" encoding="UTF-8"?>
<!--
  - Application context containing authentication, channel
  - security and web URI beans.
  -
  - Only used by "filter" artifact.
  -
  -->

<b:beans xmlns:b="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:tx="http://www.springframework.org/schema/tx"



    xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      ">


  <!-- Auto-detect components 
  <context:component-scan base-package="com.bd.entity"/> -->
  <b:import resource="hibernateDataAccessContext.xml"/>


</b:beans>

这是example-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-2.5.xsd
                           http://www.springframework.org/schema/mvc
                           http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context-3.0.xsd">

  <!-- Auto-detect controllers
  <context:component-scan base-package="com.bd.controleur"/>  -->

 <!-- the mvc resources tag does the magic -->
 <mvc:resources mapping="/resources/**" location="/resources/" />
   <!-- also add the following beans to get rid of some exceptions -->
 <bean      class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
 <bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
 </bean>


  <!--  Prepend /WEB-INF/jsp/ and append .jsp to the logical view name  -->
  <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
    <property name="order" value="1" />
  </bean>

  <!-- Access resource bundles with the specified basename -->
  <bean id="messageSource"
    class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
    p:basename="/WEB-INF/messages"/>

</beans>

这是hibernateAtaAccessContext.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:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

  <!-- Auto-detect the DAOs  
  <context:component-scan base-package="com.bd.dao"/> -->

  <context:property-placeholder location="WEB-INF/jdbc.properties"/>


    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="${database.driver}" />
        <property name="url" value="${database.url}" />
        <property name="username" value="${database.user}" />
        <property name="password" value="${database.password}" />
    </bean>



    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="annotatedClasses">
            <list>
                <value>com.bd.entity.Article</value>

            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>     
                <!-- generation base donnée     <prop key="hibernate.hbm2ddl.auto">create-drop</prop> -->
        <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
            </props>
        </property>
        <property name="eventListeners">
<map>
<entry key="merge">
<bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
</entry>
</map>
</property>
    </bean>




  <tx:annotation-driven transaction-manager="txnManager"/>

  <bean id="txnManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager"
        p:sessionFactory-ref="sessionFactory"/>

  <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>

</beans>

com.bd.entity.Article
${hibernate.dial}
${hibernate.show_sql}
创建下降

您没有发布控制器代码-我假设您只是错过了具有类似
/GererArticle