2015-04-01 91 views
0

首先,我在edit.jspSpring MVC的IE7重定向

@RequestMapping(value = "/saveUser.do") 
public String saveUser(User user) { 
    userService.save(user); 
    return "redirect:/listUser.do"; 
} 

執行save.do我那麼系統重定向到list.do

@RequestMapping(value = "/listUser.do") 
public String listUser(User user, HttpServletRequest request) throws Exception { 

    List<User> list = userService.getAll(user, getRowBounds(request)); 
    request.setAttribute("list", list); 
    return "/framework/system/user/listUser"; 
} 

當我使用鉻,頁面會查看新的數據。 但是如果我使用IE7,頁面不會查看新的數據,只能查看舊的數據。 但IE11似乎工作正常。

+0

IE7不清除緩存自動,你必須這樣做手工。 – adarsh 2015-04-01 09:18:31

+0

坦克,我找到答案.http://stackoverflow.com/questions/4364622/how-to-set-header-no-cache-in-spring-mvc-3-by-annotation – 2015-04-02 03:17:13

回答

0

坦克爲每一個。 我找到答案。

添加

<mvc:interceptors> 
 
    <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> 
 
</mvc:interceptors>

how to set header no cache in spring mvc 3 by annotation