[jboss-user] [JBoss Seam] - s:link invoking page action for CURRENT page during postback

JohnEChesher do-not-reply at jboss.com
Mon Apr 30 15:44:26 EDT 2007


Scenario:
Page A contains an s:link to go to page B.  Page A has a page action defined in pages.xml.  From Page A, when I click on the s:link to go to Page B, it invokes the page action for Page A before redirecting to Page B.

I have this scenario in multiple instances within my application.  In most cases, I didn't even realize that it was invoking the page action for Page A, as by luck the method was designed such that it did not throw an exception or cause any other noticeable problems.  However, I finally noticed this behavior when my luck ran out and I wrote a page action method that threw an exception when called unitentionally in this situation.

I have since added conditional logic to the page action method to keep it from throwing an exception in this case, while still providing the needed functionality when called "intentionally", i.e., when the page it is associated with is actually going to be rendered.  However, unless there is a possible benefit to this that I am not aware of, it would appear that the page action should not be invoked and is performing unnecessary and undesired work.

Is this perhaps a bug in s:link or am I not properly understanding and utilizing its capabilities?
Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041958#4041958

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041958



More information about the jboss-user mailing list