开发者

after back button, portlet does not go in to processaction

开发者 https://www.devze.com 2023-03-15 10:28 出处:网络
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.

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.


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>


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

0

精彩评论

暂无评论...
验证码 换一张
取 消