2016-05-19 8 views
1

私は、Webアプリケーション開発にブラウザの戻るボタン問題に直面したいので、私は私のservlet-context.xml設定春のサーブレットコンテキスト内のインターセプターMVC 3.2.8

<?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:context="http://www.springframework.org/schema/context" 
    xmlns:util="http://www.springframework.org/schema/util" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xmlns:p="http://www.springframework.org/schema/p" 
    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.2.xsd 
     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd "> 


     <!-- configuration for handling browser back button --> 
    <mvc:interceptors> 
     <mvc:interceptor> 
      <mvc:mapping path="/**/*"/> 
      <beans:bean id="webContentInterceptor" class="org.springframework.web.servlet.mvc.WebContentInterceptor"> 
       <beans:property name="cacheSeconds" value="0"/> 
       <beans:property name="useExpiresHeader" value="true"/> 
       <beans:property name="useCacheControlHeader" value="true"/> 
       <beans:property name="useCacheControlNoStore" value="true"/> 
      </beans:bean> 
     </mvc:interceptor> 
    </mvc:interceptors> 

... 
</beans> 

にこれを追加しかし、コンパイルするとき、私はこの問題を持っています:

org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 118; The prefix "beans" for element "beans:bean" is not bound.:org.xml.sax.SAXParseException:The prefix "beans" for element "beans:bean" is not bound. 

答えて

0

以下でBeanを宣言するようにしてください;)

<bean id="webContentInterceptor" class="org.springframework.web.servlet.mvc.WebContentInterceptor"> 
    <property name="cacheSeconds" value="0"/> 
    <property name="useExpiresHeader" value="true"/> 
    <property name="useCacheControlHeader" value="true"/> 
    <property name="useCacheControlNoStore" value="true"/> 
</bean> 

または豆NAを追加mespace xmlns:beans = "http://www.springframework.org/schema/beans"のように;)

<?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:context="http://www.springframework.org/schema/context" 
    xmlns:util="http://www.springframework.org/schema/util" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:beans = "http://www.springframework.org/schema/beans" 

    ... ... 
関連する問題