Why don't you have a servlet that is called on startup to execute some 
business logic class that loads the drop down list items into a collection 
and then store then in the application scope.  This increases memory, but 
also increases speed.  Then you can use the collections and the struts 
tablib for the list?


>From: "Jakkampudi, ChandraseKhar" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
>Subject: RE: Pre and Post Processing
>Date: Tue, 12 Feb 2002 14:56:20 -0600
>
>Is there an alternative to breaking the MVC?? We have to populate drop 
>downs
>from the database. So I call the DAO from the JSP through a Helper Object
>(will convert this to a tag) and use the returned collection to populate 
>the
>drop down using the html:select tag. For efficiency, we may store this
>collection in application scope. The alternative (I think) is that we 
>create
>an action for this purpose and call the database from within the perform
>method which returns null?? Isn't that a lot of overhead to populate drop
>downs?
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 12, 2002 11:49 AM
>To: Struts Users Mailing List
>Subject: Re: Pre and Post Processing
>
>
>
>
>Serious breach of MVC though!
>
>What don't you like about the select implementation?  I think it's cool!
>
>Dave
>
>
>
>
>
>Sarah Farrell <[EMAIL PROTECTED]> on
>02/11/2002
>10:19:26 PM
>
>Please respond to "Struts Users Mailing List"
>       <[EMAIL PROTECTED]>
>
>To:   "Struts Users Mailing List"
>       <[EMAIL PROTECTED]>
>cc:    (bcc: David Hay/Lex/Lexmark)
>Subject:  Re: Pre and Post Processing
>
>
>
>I'm relatively new to struts too.  But I really don't like the HTML select
>implementation.  So I use a custom tag to fill in select/option lists.  In
>fact
>I have to use this tag throughout my application so I made it very generic.
>My
>select/option lists almost always come right from my database.  So I made a
>tag
>that takes a SQL statement as an attribute, the name of the field that I
>want
>as the option value as the 2nd attribute, and the name of the field I want
>displayed in the list as the 3rd attribute.  The tag class builds a
>stringbuffer with "<option value=[field1]>[field2]</option>" strings for
>each
>row returned from the SQL statement.
>
>Then I use the struts form/action classes to verify the result of 
>submitting
>the form.
>
>
>
>
>At 05:35 PM 2/11/2002 +0000, you wrote:
> >Hello.
> >
> >I'm new to struts, and I'm having a discussion with one of our designers
> >about pre and post processing in web pages.
> >
> >Previously, we have used the standard JSP way of creating pages, with 
>lots
> >of code in the top and body of pages, in order to access functionality we
> >have exposed in some Java beans.  These Java beans wrapper XML services
> >provided by our Forte 4GL back end.
> >
> >Say we have a form which accepts customer details.  I can see how the
>Struts
> >mechanism allows us to put the code that was previously at the top of the
> >next JSP page into an ActionHandler, which decouples the flow of pages
>quite
> >nicely, and we have a nice way of doing post processing on the contents 
>of
>a
> >page.
> >
> >However, if we have a page that has to display a list of addresses for a
> >customer, and we have to run some code to get the list before we can
>display
> >it, where should this code live?  Should it be in the ActionHandler with
>the
> >previous page's post processing, or is there a better place to put it?  
>Or
> >would you suggest writing a custom tag to perform the pre-processing?
> >
> >Thanks for any thoughts,
> >
> >Tim.
> >
> >
> >This e-mail and its attachments are for the use of the addressee only.
> >It may contain information that is legally privileged, confidential and
> >exempt from  disclosure.  It is not a contract, and prices, data
> >and other information are not warranted as to completeness or accuracy.
> >Any comments or statements  made herein do not necessarily
> >reflect those of PanCredit Systems Limited. If you are not the intended
> >recipient you must not copy, distribute or disseminate this e-mail
> >or attachments to anyone other than the addressee.
> >If you receive this communication in error please advise us by telephone
> >at once.
> >PanCredit Systems Limited
> >Tel:   +44 113 250 0260
> >Fax:   +44 113 250 0621
> >
> >
> >--
> >To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>
>


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to