On 12/5/05, Garner, Shawn <[EMAIL PROTECTED]> wrote: > > Can somebody elaborate on more uses of these? > > > > init() > > preprocess() > > prerender() > > destroy()
Feature description of the "View Controller" feature: http://struts.apache.org/struts-shale/features-view-controller.html The javadocs for ViewController are also pretty thorough. They're in the package you downloaded, as well as available online: http://struts.apache.org/struts-shale/features-view-controller.html I currently have a start and save struts (in a struts 1.1) methods that > populate the form bean values from a session object for the start and save > the values from the form bean into a session value object. > > Could these be used for the same purpose with a managed bean in a shale > application? Partly. The stuff you do in a "start" type action could go in the prerender() method. The "save" type action (in a Struts app) would generally correspond to the action method that you bind the submit button to. A particular use case might make this more clear. Let's assume that you have some sort of a table that is going to display a bunch of data out of your database. You obviously do not want to leave the database connection open across requests, so in Struts you'd typically write a start action that loaded up all the data into an array of beans or something, and then released the database connection. The page would be able to render it. With Shale, another design approach would be something like this: * In the prerender() method, go get the JDBC connection and execute your query (or go get your Hibernate session and execute the query; whatever technology you're using is fine). * In the page itself, the components would be bound to a DataModel representing this data. As the components rendered themselves, you'd be indexing through the beans as usual. * In the destroy() method, which is called after rendering is complete, you can release the JDBC connection (or close down your Hibernate session, or whatever). Craig Shawn > > > > > > **************************************************************************** > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > > **************************************************************************** > >