Hi Jose Manuel,

as you comment, in your design JSP is accesing database. In a pure MVC model 2 design, database should be accessed preferably by an Action. JSP is most focused for presentation purposes. Why do noy you access database from the Action to get the Vector and store it in session to make it available for the whole app?

If you access database from the Action you can send the Vector to the JSP by using the request.

It also depends also of the lifecycle of this Vector in your app.

Storing the vector in session scope is not a bad design practice, in turn this is the session scope objective: to store data for the user session. Just check that size is not too large, and remove it as soon as you do not need it anymore.

If Vector is intended to be used by any user, you can load it in ServletContext (system) under demand: if (vector == null)
loadVector()
then you enable any server, running a different machine,to load the vector and not just the first one.


Hope it helps,

Adolfo.

From: "Castaņeda Santana, Jose Manuel" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: Passing objects from JSP to Action (in request scope)
Date: Thu, 20 Nov 2003 09:51:19 +0100


Thanks again, Adolfo!


        I think the MVC model is respected: in the second JSP I´v received a
vector with the results of a DB query that is done in the       previous
action (Action1): I need        this vector in the following Action
(Action2); how to pass it, avoiding session scope?


JSP1------> Action1 ------->JSP2 (here)------request------>Action2


        I mean, I want to handle this object (the vector) as I do with the
data of the JSP2's form fields: to send it. Is there any way to         do
this?

Thanks again, I hope this will be the last question about this item!

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


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to