after back button, portlet does not go in to processaction

那年仲夏 提交于 2019-12-12 01:55:15

问题


I have a portlet which involves displaying several JSP pages.

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.

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).

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


回答1:


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>



回答2:


Without seeing any code, it sounds as if your form response may be cached. What is the method attribute on your <form> ? Forms submitted via GET (or no method attribute at all) are allowed to be cached; in which case neither the server nor your portlet's processAction(...) will be invoked - the browser will re-render the previous response from cache.

If you post some code there may be more offers to help...



来源:https://stackoverflow.com/questions/6456076/after-back-button-portlet-does-not-go-in-to-processaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!