struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <>
Subject RE: setting Form values from JSP for an object
Date Wed, 14 Jan 2004 11:46:19 GMT
Hi Claire

have you tried the nested-tag?

like this?

<nested:form action="/nested">
	<nested:nest property="details">
	name: <nested:text property="name"/><br/>
	ref: <nested:text property="reference"/><br/>
your formBean (detailsForm) is associated action-path /nested



-----Original Message-----
From: Claire Wall [] 
Sent: Wednesday, January 14, 2004 12:36 PM
To: Struts Users Mailing List
Subject: setting Form values from JSP for an object


In have an ActionForm which contains an object called 'Details' like so:

public class DetailsForm extends ActionForm
    private Details details = new Details();
    public void setDetails(Details details)
    this.details = details;

    public Details getDetails()
        return details;

 and the Details class contains two strings: name and reference, plus
the getters and setters.

Now the problem i have is that in my JSP i can render these values fine
in text boxes. I want the user to be able to change the values, submit
the form and then save the changes. However, I cannot find the way that
will call the setters of the Details object. Is this possible and how is
it done? I have tried the following ways in my JSP:

Firstly, defined a bean and then used this bean definition to render my
text boxes:

<bean:define id="detail" name="DetailsForm" property="details"/>

<html:text name="detail" property="name" style="width:150px"/>
<html:text name="detail" property="reference" style="width:150px"/>

<html:submit><bean:message key=""/></html:submit>

Secondly, didnt define the bean using <bean:define> but instead did

<html:text name="DetailsForm" property=""
style="width:150px"/> <html:text name="DetailsForm"
property="details.reference" style="width:150px"/>

<html:submit><bean:message key=""/></html:submit>

This didnt work either, I'm assuming because only the setters are being
called, and not get().set() like I want..

Is there any way to call the setters for a class within my ActionForm??
Any help would be appreciated.

Claire :)

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

View raw message