struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McGrady <m...@michaelmcgrady.com>
Subject Re: some best practices questions
Date Wed, 07 Jul 2004 03:58:16 GMT
I think the obvious is important with this recurrent problem.  The obvious 
is that you want to persist data for a period that is not coincident with 
the normal devices for doing that. i.e. request, session and context 
scopes.  The difficulty is matching up with storage method on the server 
with the "life-term" of the client.  There are any number of solutions to 
this problem with varying pluses and minuses, and I think you really have 
to solve what you need for your problem.  I have no doubt that there are 
recurrent problems and that some general solutions to those particular 
recurrent problems would be useful.  I have been mulling this around in my 
head for a while trying to get some sense about this.  I wouldn't mind an 
ongoing discussion group on this alone somehow, if there were a way to do 
that.  I might create a forum for that.



At 07:43 PM 7/6/2004, you wrote:
>I recently developed an application with a complex UI. One of the pages 
>required querying the database based on user selection and re-displaying 
>the page with the retrieved data and any previous existing user 
>selections. Four different fields can trigger a db query resulting in page 
>re-display and validations can also result in page re-display. Each time 
>the page is re-displayed, the "state" of the page must be "remembered" 
>from the last time it was displayed. (still with me so far?) Most of the 
>data retrieved is list data displayed in single- or multi-select lists and 
>populated using html:options collection and LabelValueBean. (for those of 
>you reading this post who have developed similar code, you will know what 
>I'm referring to).
>
>In the action, the retrieved data is placed in session scope to minimize 
>db hits. I thought this was a good idea at the time. For some reason, 
>placing data in session scope is frowned upon by some members of my team 
>(even if improves performance). Anyways, what I need are some ideas of the 
>best practices that fellow Struts users follow when a page requires 
>querying the db and re-displaying the page with the retrieved data and 
>previous selections if placing the data in session scope is not an option. 
>How can I recall the previously retrieved data without requerying the db? 
>Would it make sense to hide the data in the page? (i.e. either using 
>hidden fields or hidden select lists or to generate a JavaScript array). 
>What are the risks, if any, of hiding the data in the page? (i.e. performance).
>
>If anyone has developed similar pages, can you tell me if you decided for 
>or against placing data in session scope and why?
>
>Any ideas would be appreciated.
>
>Thanks in advance.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message