-
1. Re: Postback/form resubmission detection
gavin.king Oct 9, 2006 1:16 PM (in response to alpheratz-jb)If you do the work in a long-running conversation, and then end that conversation when redirecting back to the home page, then Seam automagically detects that the conversation is over when the form is resubmitted.
It Just Works.
Try this out in the booking demo. -
2. Re: Postback/form resubmission detection
alpheratz-jb Oct 10, 2006 8:47 AM (in response to alpheratz-jb)It Just Works.
It sure does! MANY thanks...it is coming together for me now!
My (poor longsuffering) wife just heard me exclaim "Gavin, you genious!"
I LIKE this feature (now I understand it, of course...)
This is exactly what I mean by "simple solution" and "a high-level note".
When I evaluate a framework, I am looking for "added value", or more "bang for buck." This feature just did it for me ;-)
I have been looking at apache shale (didn't seem enough of a "leap forward"); spring (I just LOVE the way that people are saying that EJB2.x descriptors are too complex, and then wading into spring's morasses of XML configuration; easier testability is nice, though) and Seam....Seam "felt right" to me, in terms of making proper use of the latest and greatest, but I couldn't see my way through.
So: many thanks. This is Good Work.
Alph. -
3. Re: Postback/form resubmission detection
gavin.king Oct 10, 2006 1:36 PM (in response to alpheratz-jb)Cheers ;-)
P.S. I think you'll like Seam 1.1 even better, when it finally gets born... -
4. Re: Postback/form resubmission detection
alpheratz-jb Oct 10, 2006 5:22 PM (in response to alpheratz-jb)Looking forward to 1.1! Already like <s:decorate>...
Any suggestions to how to handle the UI aspects of postback.
At the moment, I can use <h:messages /> to display "No conversation" at the bottom of the page but I'd like to be able to display something nicer. I guess also I'd like to be able to display a friendlier message against a field (say the first on the page, for argument's sake).
Cheers,
Alph -
5. Re: Postback/form resubmission detection
gavin.king Oct 10, 2006 5:26 PM (in response to alpheratz-jb)You can use the <s:message/> tag with <s:decorate/>, just like in the updated booking example in CVS, or just use <h:message for="inputId"/>.
Or isn't that what you are asking? -
6. Re: Postback/form resubmission detection
alpheratz-jb Oct 10, 2006 11:21 PM (in response to alpheratz-jb)I haven't yet actually tried the <s:*> tags YET.
I have <h:message for=""> with my input elements and <h:messages> in the page body...
When I do a back-button/resubmit, I see no messages against any input element and only "No conversation" from the <h:messages> tag.
I guess that the "you are not in a conversation" situation does not occur due to a validation error and so is not 'for' any input element...
As an aside, in the JBoss log, I see:
[ConversationInterceptor] no long-running conversation for @Conversational bean: disasterManager
This is good.
The issue is how to make this situation more 'beautiful' for the user...can I hook into things somewhere so that I can present a more user-oriented message like "please don't do back/submit...you dolt" ;-)
Cheers,
Alph -
7. Re: Postback/form resubmission detection
gavin.king Oct 10, 2006 11:59 PM (in response to alpheratz-jb)Just set org.jboss.seam.NoConversation=..... in your messages.properties file.
-
8. Re: Postback/form resubmission detection
alpheratz-jb Oct 11, 2006 4:33 AM (in response to alpheratz-jb)Sigh. Nothing is ever easy, eh!
I get:
===
javax.servlet.ServletException: could not instantiate ClassValidator
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
...
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
18:22:05,562 INFO [SeamExceptionFilter] killing transaction
18:22:05,562 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalArgumentException: could not instantiate ClassValidator
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:265)
at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:233)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:176)
...
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key validator.length
at java.util.ResourceBundle.getObject(Unknown Source)
at java.util.ResourceBundle.getString(Unknown Source)
at org.hibernate.validator.ClassValidator.replace(ClassValidator.java:518)
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:260)
... 46 more
===
I saw this:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928305
Is this still an issue...should I go to the shiny new version in CVS (planning to give it a try anyhow...)
Cheers,
Alph -
9. Re: Postback/form resubmission detection
alpheratz-jb Oct 11, 2006 4:40 AM (in response to alpheratz-jb)current workaround is to copy default messageset from
org.hibernate.validator.resources.DefaultValidatorMessages.properties
Then...its like a bought one!
Still...I'll have to give CVS version a try.
Alph