[jboss-user] [JBoss Seam] - Postback/form resubmission detection

alpheratz-jb do-not-reply at jboss.com
Mon Oct 9 08:07:38 EDT 2006


This is probably a FAQ but here goes anyway.

Consider a very simple app (PURE JSF, no pageflows, etc): 1 home page that kicks off to a form that, on successful submission returns to the home page (which redisplays the--now updated--data).

Consider: the user now hits the browser back button and resubmits the data.

The question is...how to handle this in Seam?

I guess that the ultimate answer would be to move to Seam's pageflow mechanism...I have read sect. 4.1.2, etc. and I agreee that for a bigger app, this is the way to go, but for the very simple situation I have here it isn't really worth it.

EXCEPT that I can't get a clear feeling for any alternative.

For example:

http://www.jroller.com/page/cagataycivici/weblog/ispostback_in_jsf

Presents what looks to be a promising solution but to quote: "I just realized that requestParamMap trick won't work when a navigation happens without a redirect. It does not always works."

I read in 4.1.2 that "However, our experience is that in the context of Seam, where there is a well-defined conversational model, backed by stateful session beans, it is actually quite straightforward. Usually it is as simple as combining the use of the @Conversational annotation with null checks at the beginning of action listener methods. We consider support for freeform navigation to be almost always desirable."

Is there an example of this to look at?

I would love some guidance here! I am making no real headway.

On a more high-level note: this seems such a simple thing (and was in struts: saveToken(), etc. [but it nonetheless felt 'unsatisfactory']) Shale has an equivalent s:token tag but that again seems much too low-level for Seam. From my googling for a solution, it would seem that Seam could really help the average Joe Programmer if it implemented a simple solution.  My AU$0.02 worth (I'm up in sunny Bribane, Oz).

Thanks in advance! All help is really gratefully appreciated.

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

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



More information about the jboss-user mailing list