FireFox 3.5 缓存的 JSF 问题,wyciwyg:// 前缀

发布于 2024-08-16 10:00:29 字数 1801 浏览 3 评论 0原文

我是 JSF 新手,我的简单 JSF 应用程序有问题。我在 WebLogic 10.3.2 (11g) 上使用 Facelets 和 Richfaces。该申请基本上有 3 页:

A <--> B<--> C

,其中中间箭头表示导航规则。导航是通过a4j:commandButtons执行的。问题是在Firefox 3.5中,当我从B点击到C时,我得到一个从wyciwig://开始的url。更详细地说,起始网址为:

http://localhost:7001/myapp/index.faces

,当我从 B 导航到 C 时得到的 url 是这样的:

wyciwyg://20/http ://localhost:7001/myapp/index.faces

从 Google 搜索中我看到 wyciwig 是 WhatYouCacheIsWhatYouGet,所以问题可能与缓存有关。在这个方向上,我做了两件事:

A. 我添加了以下元标记:

<meta http-equiv="Pragma" content="No-cache"/>
<meta http-equiv="Cache-Control" content="no-store,No-cache,must-revalidate,post-check=0,pre-check=0,max-age=0"/>
<meta http-equiv="Expires" content="-1"/>

B. 我添加了一个 PhaseListener 来添加 HTML 标头标记,如建议的 此处

不幸的是,问题仍然存在。

另一件可能相关的事情是,由于某种原因,我的导航不会更改浏览器地址栏中显示的 url。当我将鼠标悬停在 a4j:commandButtons 上时,状态栏中显示的链接始终为

http:// /localhost:7001/myapp/index.faces#

所以问题如下:

  1. 为什么会出现这个 wyciwyg://20/ 前缀,我该如何克服这个问题?
  2. 在从一个页面导航到另一个页面时,如何更改 url?这会让“后退按钮起作用”吗?

干杯!

更新1:这些人这里(葡萄牙语文本)说用 a4j:htmlCommandLink 替换所有 a4j:commandLink 可以解决问题。我做到了,他们是对的。我不明白原因,通过。

I am new to JSF and have a problem with my simple JSF application. I use Facelets and Richfaces on WebLogic 10.3.2 (11g). The application is essentially 3 pages:

A <--> B <--> C

where the intermediate arrows denote navigation rules. The navigation is performed through a4j:commandButtons The problem is in Firefox 3.5, when I click from B to C, I get a url starting from wyciwig://. In more detail, the starting url is:

http://localhost:7001/myapp/index.faces

and the url I get when I navigate from B to C is this:

wyciwyg://20/http://localhost:7001/myapp/index.faces

From a Google search I saw that wyciwig is WhatYouCacheIsWhatYouGet, so the issue is probably related to caching. In that direction, I did two things:

A. I added the following meta tags:

<meta http-equiv="Pragma" content="No-cache"/>
<meta http-equiv="Cache-Control" content="no-store,No-cache,must-revalidate,post-check=0,pre-check=0,max-age=0"/>
<meta http-equiv="Expires" content="-1"/>

B. I added a PhaseListener to add HTML header tags, as suggested here.

Unfortunately, the problem persists.

Another thing that could be related is that for some reason my navigation does not change the url that appears in the address bar of the browser. The links that appear in the status bar when I hover the mouse over the a4j:commandButtons is always

http://localhost:7001/myapp/index.faces#

So the questions are the following:

  1. Why does this wyciwyg://20/ prefix appear, and how can I overcome this?
  2. What can I do to change the url when navigating from page to page? Will this make the "Back button work"?

Cheers!

UPDATE 1: These guys here (text in Portuguese) say that replacing all a4j:commandLink with a4j:htmlCommandLink fixes the problem. I did, and they are right. I don't understand the reason, through.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

两仪 2024-08-23 10:00:29

实际上,答案相当简单,并在 RichFaces 常见问题解答中进行了解释,我建议您仔细阅读!

ajax 组件不是为页面导航而设计的,以这种方式使用时将无法工作。

请参阅 http://community.jboss.org/wiki/CommonAjaxRequestsProblems#navigation

a4j 的原因:htmlCommandLink 的工作原理是它并不是真正的 ajax 组件,而是一个普通的旧 HTML 链接标记。

希望这有助于解释事情。

Actually the answer is fairly simple and explained in the RichFaces FAQ which I suggest you read thoroughly!

The ajax components are not designed for page navigation and will not work when used this way.

See http://community.jboss.org/wiki/CommonAjaxRequestsProblems#navigation

The reason a4j:htmlCommandLink works is that it is not really an ajax component but a plain old HTML link tag.

Hope that helps explain things.

西瓜 2024-08-23 10:00:29

这与其说是 JSF 问题,不如说是 Firefox 问题。事实上,您永远不应该在地址栏中看到这些链接。可能您的 Firefox 环境或其插件之一被搞乱了。尝试此故障排除指南。如果无效,请卸载所有内容并重新安装干净的 Firefox。您最终还可以在另一台物理机器上使用 Firefox 进行测试,看看它是否确实是由 Firefox 或您的网络应用程序引起的。

This is more a Firefox problem than a JSF problem. You should in fact never see those links in the address bar. Likely your Firefox environment or one of its plugins is messed up. Try this troubleshooting guide. If in vain, uninstall everything and reinstall Firefox clean. You can eventually also test on a phyisically another machine with Firefox to see if it is actually caused by Firefox or your webapp.

撩动你心 2024-08-23 10:00:29

这是部分答案,意味着它展示了如何解决该问题,但没有解释它最初发生的原因。

为了澄清哪些组件导致了这个问题,我用 5 个组件替换了每个按钮:

  • a4j:commandButton
  • a4j:commandLink
  • h:commandButton
  • h:commandLink
  • a4j:htmlCommandLink

每个组件都有相同的操作。不起作用的是前两个(a4j:commandButton,a4j:commandLink)。其他的不存在任何问题。因此,为了避免这种情况,请使用 h:commandButton、h:commandLink、a4j:htmlCommandLink 中的任何一个。

关于 URL 未正确显示,这似乎是 JSF 1.2 的一个已知问题(可能在 2.0 中解决),如所解释的 此处此处。这个问题可以使用 Seam、PrettyFaces 或其他框架/库来解决。

This is a partial answer, meaning it shows how to work around the problem, but does not explain why it occurred in the first place.

In order to clarify which components cause this problem, I replaced each button with 5 components:

  • a4j:commandButton
  • a4j:commandLink
  • h:commandButton
  • h:commandLink
  • a4j:htmlCommandLink

Each component has the same action. The ones that do not work are the first two (a4j:commandButton, a4j:commandLink). The others do not present any problem. So, in order to avoid it, use any of h:commandButton, h:commandLink, a4j:htmlCommandLink.

About the URL not showing correctly, it seems to be a known issue of JSF 1.2 (possibly solved in 2.0), as explained here and here. This problem is solved using frameworks / libraries such as Seam, PrettyFaces or others.

傲娇萝莉攻 2024-08-23 10:00:29

您可以尝试以下方法:

  1. 打开 Mozilla
  2. 在地址栏中输入: about:config
  3. 设置 browser.cache.memory.enable = FALSE
  4. 重新启动浏览器
  5. 加载您的页面并尝试!

祝你好运! :)

You can try this way:

  1. Open Mozilla
  2. Type in AddressBar: about:config
  3. Set browser.cache.memory.enable = FALSE
  4. Restart browser
  5. Load your page and try!

Good Luck! :)

桃气十足 2024-08-23 10:00:29

遇到同样的问题,导航上的网址没有更新。

在 faces-config.xml 内的每个导航规则中添加重定向标记解决了我的问题。

在以下网址中找到解决方案:

http://www.java-samples.com/ showtutorial.php?tutorialid=603

Had the same problem, the url didn't update on navigation.

Added a redirect tag inside each of the navigation rules inside faces-config.xml solved my problem.

Solution found in the following url:

http://www.java-samples.com/showtutorial.php?tutorialid=603

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文