struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shirishchandra.sakh...@ubs.com
Subject RE: Validator (newbie)
Date Wed, 18 Dec 2002 11:07:29 GMT
U r first Q ,I dont know ...But abt 2nd may be i have some suggestion form my 
experience with struts ..
>>>2. What is the standard way to pass data from Action objects to the JSP
(view)? Should the data be sent as a) Session properties, b) Some bean
objects, or c) Data members of the Action object?

GEnerally u should try to avoid using session variables.So the standard way is 
to pass the data in request scope.So if the data u want to use in jsp is 
attribute of the formBean,then as the form bean is available to the jsp , u can 
use it there...I think this keeps the design clean as the form bean actually 
represents the form data..So u dont have to look at the action class to see 
what u are trying to put on jsp..The form bean is the place...	

-----Original Message-----
From: suresh.addagalla [mailto:suresh.addagalla@wipro.com]
Sent: Wednesday, December 18, 2002 12:02 PM
To: struts-user
Subject: Validator (newbie)


Hi,

I have a couple of basic questions.

1. If we use ActionForm, the ActionServlet first executes the validate()
method before calling execute() on the corresponding Action. If I switch
from ActionForms to Struts Validator (that is, use ValidatorForm instead
of ActionForm), do things work the same way? Is it that in this case
also, ActionServlet calls the validate() just before calling the
execute()?

2. What is the standard way to pass data from Action objects to the JSP
(view)? Should the data be sent as a) Session properties, b) Some bean
objects, or c) Data members of the Action object?

Thanks,
Suresh



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


Mime
View raw message