struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heligon Sandra <>
Subject FormBean (ActionForm) vs BusinessObject (JavaBean)
Date Tue, 21 Jan 2003 15:35:22 GMT

	I am writing a document about the design of my struts application
	I have difficulites to explain the view components behavior.
	It is probabaly because I don't understant well how the view part of
	Struts framework runs.

	Here as I work and thank you in advance to indicate to me that it is
the best method if it is not this one. 
	All the data which I wish to display is reprensted in the form of
JavaBean. Through the action class
	I ask to the remote application server a XML description of the
businness object and then I fill a JavaBean 	instance.
	In the JSP I use the bean tag library (bean:write for example) to
display data.
	In the cas of  the view must accept input from users, I have used an
DynaActionForm (or
	FormBean I think it is two words for the same context isn't it ?).
	I define a <form-property> for each input of the user. Then in the
JSP page I add the tag 
	<html:form> and <html:text property= > to point on a specif property
in the case or I need 
	to save the value of the input user, I defined a JavaBean class to
store this information.
	The JavaBean is updated in the Action class, with this method:
		DynaValidatorForm loginForm = (DynaValidatorForm)form;
		User userInfo;
		String userName = (String)(loginForm.get("userName"));
            	String password = (String)(loginForm.get("password"));
            Is it the best think to do with an aim of ensuring
synchronization between FormBean and Business 	Delegates/Value objects .
	We have the impression to duplicate variables that are in your Value
Objects in your form object.
	The code example describes the link FormBean -> JavaBean (value
object). But I never use
	the link JavaBean (value object) -> FormBean because in this case I
used the bean:write tag.
	I am not perhaps very clear to excuse me but it is undoubtedly with
the fact that I have difficulties to 	understand well how runs the Struts
view components (FormBean).
	if somebody has a diagram which explains this mechanism thank you
to send it.

 <<...OLE_Obj...>>  <<...OLE_Obj...>>  <<...OLE_Obj...>>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message