I would just do a check in your prepare() method to see if the list is
already in the session.
Matt
lixin chu wrote:
Hi,
Would like to understand more about sorting and
requestURI.
I am using Struts and DisplayTag. I have a page with a
list of Objects stored in a database. I have a
LookupDispatchAction handling the various actions on
the page. The workflow is something like this:
menu -> prepare() in myAction -> show JSP page with
displayTag
Btn clicked on JSP -> other method() in myAction
The prepare() method will initialize necessary data,
including retrieve list of objects from a database and
put is into SESSION.
Now, the question is, which method will be invoked
when I do sorting in the table ?
I use requestURI="", or requestURI="myAction.do". Both
solution calls the prepare() method in myAction - I do
not know why.
But the problem is that I should not call prepare()
method again when doing sorting because:
1) it does not make sense to retrieve objects again
from the database since it is already put into the
session.
2) it is likely that the objects are modified but not
yet persisted. So in fact I can not retrieve them
again.
In this situation, should I provide a dummy() method
in myAction to handle sorting ? Is it a common
practice ? I have not tested but I guess it should
look like this:
requestURI="myAction.do?method=dummy"
thanks for your advice.
li xin
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user