struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suresh Addagalla" <suresh.addaga...@wipro.com>
Subject RE: Validator (newbie)
Date Wed, 18 Dec 2002 11:17:04 GMT
Hi,

Using request scope instead of session makes sense.

One question on your suggestion. Usually the form bean represents the
form data of the "previous" page. The data, which is required to be put
in the view (JSP), most probably would not be present in the form bean.
So, how can we say that using the form bean is the best idea. In the
scenario which I described, what can be the alternative and best
practise?

Thanks,
Suresh

>-----Original Message-----
>From: shirishchandra.sakhare@ubs.com 
>[mailto:shirishchandra.sakhare@ubs.com] 
>Sent: Wednesday, December 18, 2002 4:37 PM
>To: struts-user@jakarta.apache.org; suresh.addagalla@wipro.com
>Subject: RE: Validator (newbie)
>
>
>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
>
>


Mime
View raw message