后退按钮后,portlet不会进入processaction [英] after back button, portlet does not go in to processaction

查看:81
本文介绍了后退按钮后,portlet不会进入processaction的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Portlet,其中涉及显示几个JSP页面.

I have a portlet which involves displaying several JSP pages.

在第一个JSP page A中,当我单击Page A上的Submit按钮时,processAction()方法将执行操作,并出现一个JSP page B.

In first JSP page A, when I click the Submit button on Page A the processAction() method takes action and a JSP page B appears.

现在,如果我将Web浏览器的后退按钮用于page A,然后再次单击Submit按钮, JSP page B出现了,但是我注意到processAction()没有采取任何措施. (通常,在JSP页面中单击Submit按钮可以使processAction()采取行动.)

Now if I use Web Browser's Back button to page A and click the Submit button again, the JSP page B appears but I noticed the processAction() didn't take any action. (Usually clicking Submit button in a JSP page can result in the processAction() to take action).

有人可以帮助解决这个问题吗?在我的Porlet中,它必须进入流程操作,但不要在返回按钮之后.

Can anyone help for this problem? In my Porlet, it MUST go to the process action but it doesn't after back button.

推荐答案

这是默认行为.门户网站默认情况下启用了"Multiple Action URL Protection".页面加载时,将创建一个操作链接,该链接包含action ID.不能在同一会话中再次使用相同的动作ID.因此,当您单击后退"按钮时,如果页面是从历史记录缓存中加载的,则您的表单包含与以前使用的动作链接相同的链接.因此,门户网站简单地重新加载页面,而不是调用processAction(). 您可以通过在portlet.xml文件中为portlet添加以下配置来禁用此功能.

This is the default behavior. Portal has "Multiple Action URL Protection " enabled by default. When a page loads, an action link is created and that link contains an action ID. The same action ID cannot be used again in the same session. So when you click on Back Button, if the page is loaded from the history cache, your Form contains the same action link which was used before. So portal simple reloads the page, rather than calling the processAction(). You can disable this by adding the following configuration for your portlet in portlet.xml file.

<init-param>
   <name>wps.multiple.action.execution</name>
   <value>true</value>
</init-param>

这篇关于后退按钮后,portlet不会进入processaction的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆