On 11/30/06 7:45 PM, "Christopher Schultz" <[EMAIL PROTECTED]> wrote: > Mark Menard wrote: >> public String getDataRetrievedFromSessionBean () { >> return this.dataRetrievedFromSessionBean; >> } > > Sorry for poking my nose in, but wouldn't this be horrendously > non-threadsafe?
No problem. If your thinking of Actions from the perspective of S1, yes, this would be horribly non-thread safe. In S2 an action instance is created for each request. They are not singletons. So, this is fine. > Since I know virtually nothing about S2, I may be completely missing > something like action instances now live in the session or something > crazy like that. They don't live in the session. In a sense they live in the request scope. I say that because the Action itself also takes on the role formerly done by the ActionForm in S1. It's just a JavaBean with setters and getters that is used to store the information you're interested in, the stuff submitted to you and what you want to present in your view. In S2 if you have an accessor for let's say firstName (i.e. getFirstName() and setFirstName() ) on your Action class, and you have a firstName input in your HTML form, S2 will call setFirstName() on your action with the submitted value. This gives you access to the parameters submitted by your user. It's really quite simple and elegant. You can also use any JavaBean you'd like as your form in S2 if you want. (cf: http://cwiki.apache.org/WW/model-driven-interceptor.html) Likewise anything that you want to display in your view would also be a property of your Action. Just get the data in your execute() method and make it available via a getter and you can display it via your view. Mark -- Mark Menard personal: http://www.vitarara.org/ business: http://www.vitarara.net/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]