Hi Dave,
Thanks for your reply.
I tried defining a java bean as below
public class PersonalDetailForm implements Serializable {
String name;
String dob;
String city;
public PersonalDetailForm() {}
// also defined all the getter setter methods....
}
In the action class i defined a attribute called
public PersonalDetailForm getForm() {
return form;
}
public void setForm(PersonalDetailForm form) {
this.form = form;
}
PersonalDetailForm form;
and the jsp looks like
<s:form action="doPersonal" method="POST" name="form">
<s:actionerror />
<s:fielderror />
<s:textfield name="name" label="Name" /> <br/>
<s:textfield name="dob" label="Date of birth" /> <br/>
<s:textfield name="city" label="city" /> <br/>
<s:submit value="Next" align="center"/>
</s:form>
in the action class when i do a form.getCity() it throws a
NUllPointerException....
i think the form is not initialised on the form submission... unlike struts
1.x we cannot confire the bean class in the struts-config.xml....
Can you please help?
Manoj.
Dave Newton
<[EMAIL PROTECTED]
o.com> To
Struts Users Mailing List
29/06/2007 13:53 <[email protected]>
cc
Please respond to Subject
"Struts Users Re: Struts 2.0 form bean
Mailing List"
<[EMAIL PROTECTED]
he.org>
--- [EMAIL PROTECTED] wrote:
> is there any way of defining this fields attribute
> in two separate bean classes and configure with the
> appropriate action?
Use regular JavaBeans and use the appropriate bean in
the JSP form and configure validation for each
bean/method combination.
That's a really, really long signature.
This e-mail is intended to be confidential to the recipient. If you receive a
copy in error, please inform the sender and then delete this message. Virgin
Money do not accept responsibility for changes made to any e-mail after
sending. Virgin Money have swept, and believe this e-mail to be free of viruses
and profanity but make no guarantees to this effect.
Virgin Money Personal Financial Service Ltd is authorised and regulated by the
Financial Services Authority. Registered in England no. 3072766. Entered on the
Financial Services Authority's Register http://www.fsa.gov.uk/register/.
Register Number 179271. The Virgin Deposit Account is a personal bank account
with The Royal Bank of Scotland.
Virgin Money Unit Trust Managers Ltd is authorised and regulated by the
Financial Services Authority. Registered in England no. 3000482. Entered on the
Financial Services Authority's Register. Register Number 171748.
Virgin Money Ltd. Registered in England no. 4232392. Introducer appointed
representative only of Virgin Money Personal Financial Service Ltd.
Virgin Money Management Services Ltd. Registered in England no.3072772.
Virgin Money Group Ltd. Registered in England no.3087587.
All the above companies have their Registered office at Discovery House,
Whiting Road, Norwich NR4 6EJ.
All products are open only to residents of the United Kingdom.
This message has been checked for viruses and spam by the Virgin Money email
scanning system powered by Messagelabs.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]