Topic: 页面回退的问题

  Print this page

1.页面回退的问题 Copy to clipboard
Posted by: wood
Posted on: 2005-08-05 16:48

用equinox的例子,发现,用ie浏览时,在UserForm页面输入的内容后,经过回退按钮后,内容丢失,不知道为什么?用firefox时,没有这种问题。

页面应该没有初始化之类的script。

2.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-08-11 10:22

没有同路人,,,

其实是一个简单的SimpleFormController,输入,提交,显示结果,但是在结果页面时,回退(浏览器提供的按键)到输入页面,所有输入内容全部丢失!!

尝试:去掉输入页面中的所有<spring:bind>,回退的功能就正常。

谁能解释一下?

3.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: floater
Posted on: 2005-08-11 20:56

sounds like when you press the back button, the form somehow gets reloaded from the server in IE. This is possible if your form page is a result of a post.

spring tag is nothing more than a set of html tags, you should be able to compare the html sources of the form with and without spring tag to see the difference.

4.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-08-22 15:55

在ie中确实是reloaded,可这时怎么做到的呢?是什么设置使然?

如果是post的结果,ie提示页面过期。

5.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-08-30 17:19

从controller得到的页面浏览时,如果把ie改成脱机工作(在“文件”菜单下),回到该网页,报脱机状态下网页不可用的错!

如果把这个页面保存到本地(静态页面),然后发布到同样的环境中,则正常。
推断:
静态页面没有经过spring的处理, html文件本身没有要求刷新页面,那么sping形成页面时,可能在http头做了设置。

想问:spring配置文件中,是不是有这样的设置,或者缺省值?
org.springframework.web.servlet.view.InternalResourceViewResolver
spring的版本是1.1.4

真是郁闷!!!

6.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-08-30 17:21

这是那个例子
http://raibledesigns.com/page/rd?anchor=ann_equinox_1_1_released

7.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: floater
Posted on: 2005-08-30 21:20

可能在http头做了设置 - I don't think this is true from my experience.

could you post your static html(the one you saved)? Did you do anything for the browser cache settings?

8.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-08-31 09:25

我用的是equinox1.3的freemaker版。

呵呵,这个是你的例子,

非常感谢,floater

input.htm (1.1k)

9.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-08-31 10:49

一点进展
换成1.0.2的spring.jar,就是正常;
换成1.2.4的spring.jar,仍然有同样的问题。

10.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: floater
Posted on: 2005-08-31 22:11

The html looks fine.

Next, you need to check the session. convert your html to jsp and set the session on.

Also, search here for http header settings to turn on/off browser caches.

11.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-09-01 16:16

我把它改为input.jsp,仍然是正常的!!

什么是set session on?

在ie里turn on/off caches,是临时文件那个选项吗?我的是中文版本。

可是我仍然觉得是spring生成页面时的问题啊!!同样的环境,html、jsp都没有问题呀。

12.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: auauau
Posted on: 2005-09-01 17:22

我也遇到这样的问题,关注中。。

13.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: floater
Posted on: 2005-09-01 21:03

http://www.cjsdn.net/post/view?bid=2&id=59407&sty=3&age=0&tpg=1&ppg=1#59407

http://www.cjsdn.net/post/view?bid=2&id=58488&sty=3&age=0&tpg=1&ppg=1#58488

and others, do a search.

Yes, there is a chance that spring gets into the way, through sessions. The way Spring works is that it uses sessions to temporarily store the form object and remove it once the post is trigger'd.

This problem is hard to figure out because it's more of a configuration issue - there are so many ways to go wrong and yet, there are only very few ways to do it right.

Have you done a google to see how others are doing?

14.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-09-06 16:53

http://www.iewatch.com
很好的工具,哈哈哈。

可以清楚地看到,那个页面Response的
...........
Pragma : No-cache
Expires: 1970-1-1
Cache-Control:no-cache
Cache-Control:no-store
...........

是那个设置出问题呢?
ViewResolver ?
Controller?

15.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-09-06 17:13

Pragma , Cache-Control在那里设置?

16.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: floater
Posted on: 2005-09-06 21:37

another tool is in apache axis package.

search cache-control in here, it's been posted several times. They are in the html header.

17.Re:页面回退的问题 [Re: wood] Copy to clipboard
Posted by: wood
Posted on: 2005-09-07 16:43

SimpleFormController有setUseCacheControlHeader(boolean useCacheControlHeader)的方法,去掉这个header,就不会有no-cache的控制了,

但是progma还是No-cache,呵呵,功能已经实现,以后再搞啦


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923