Jason, below is the code. I've tried various versions of xwork.xml, this is the last one (the result was always the same, the setName method is never called).
Thanks in advance Lars Action class package test.ww2; import com.opensymphony.xwork.ActionSupport; public class EditEmployeeAction extends ActionSupport { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public String editEmployee() { // do something return "success"; } } JSP <%@ taglib prefix="ww" uri="webwork" %> <html> <head><title>WebWork 2 Form Test</title></head> <body> <ww:form name="employeeForm" action="editEmployee.action" method="POST"> <table> <ww:textfield label="Name" name="'name'" value="name"/> </table> <input type="submit" value="Save"/> </ww:form> </body> xwork.xml <!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd"> <xwork> <include file="webwork-default.xml"/> <package name="default" extends="webwork-default"> <action name="showEmployee" class="test.ww2.EditEmployeeAction"> <result name="success" type="dispatcher"> <param name="location">/test/ww2/editemployee.jsp</param> </result> <interceptor-ref name="defaultStack"/> </action> <action name="editEmployee" class="test.ww2.EditEmployeeAction" method="editEmployee"> <result name="success" type="dispatcher"> <param name="location">/test/ww2/editemployee.jsp</param> </result> <result name="error" type="dispatcher"> <param name="location">/test/ww2/editemployee.jsp</param> </result> <interceptor-ref name="defaultStack"/> </action> </package> </xwork> > If it still doesn't work, show us your Action class, JSP, and xwork.xml > file > > > -----Original Message----- > > From: Lars Fischer [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, October 28, 2003 1:51 PM > > To: [EMAIL PROTECTED] > > Subject: Spam:Re: [OS-webwork] setXXX never called > > > > > > Jonas, > > > > it doesn't work, maybe the CVS version I´m using is bad. > > Will try again with a newer version ... > > > > Cheers, > > Lars > > > > > Have you included the ParameterInterceptor to doTest action in your > > > xwork.xml? > > > > > > If you <include file="webwork-default.xml"/> in your > > xwork.xml you can > > > use the predefined interceptor defaultStack as: > > > > > > <action name="doTest" class="xxx.TestAction" method="doTest"> > > > <result name="success">/index.vm</result> > > > <interceptor-ref name="defaultStack"/> > > > </action> > > > > > > Cheers, > > > Jonas > > > > > > Lars Fischer wrote: > > > > I have a simple action and a form with a text field. The > > problem is, > > > that > > > > setName(... is never called now matter what I do. The doTest() > > > > method > > > shown > > > > below is called correctly. > > > > > > > > Thanks for your help, > > > > Lars > > > > > > > > (BTW documentation still sucks - forget this WIKI thing > > and write a > > > tutorial > > > > !) > > > > > > > > Action class: > > > > > > > > public class TestAction extends ActionSupport { > > > > > > > > private String name; > > > > > > > > public String getName() { > > > > return name; > > > > } > > > > > > > > public void setName(String name) { > > > > this.name = name; > > > > } > > > > > > > > public String doTest() { > > > > // Name is alway null > > > > > > > > return "success"; > > > > } > > > > > > > > } > > > > > > > > JSP: > > > > > > > > <%@ taglib prefix="ww" uri="webwork" %> > > > > <html> > > > > <head><title>Test</title></head> > > > > <body> > > > > <ww:form name="testForm" action="doTest.action" > method="POST"> > > > > <table> > > > > <ww:textfield label="Name" name="'name'" > value="name"/> > > > > </table> > > > > <input type="submit" value="Save"/> > > > > </ww:form> > > > > </body> > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: SF.net Giveback Program. Does > > > > SourceForge.net help you be more productive? Does it > > > > help you create better code? SHARE THE LOVE, and help us help > > > > YOU! Click Here: http://sourceforge.net/donate/ > > > > _______________________________________________ > > > > Opensymphony-webwork mailing list > > > > [EMAIL PROTECTED] > > > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: SF.net Giveback Program. Does > > > SourceForge.net help you be more productive? Does it > > > help you create better code? SHARE THE LOVE, and help us help > > > YOU! Click Here: http://sourceforge.net/donate/ > > > _______________________________________________ > > > Opensymphony-webwork mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > Does SourceForge.net help you be more productive? Does it > > help you create better code? SHARE THE LOVE, and help us help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > Opensymphony-webwork mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork