#if ($parameters.nameValue) value="$parameters.nameValue" #end
(used to be $tag.actualValue).
If it looks OK, and you're not sure if you have some other template somewhere hiding the latest one, try disabling the velocity servlet in altoghether and go to /template/xhtml/text.vm to se the result that the tags is actually served.
Also, have you tried debugging the action class to see if the variables are set?
Cheers,
Dag
Lars Fischer wrote:
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-----method="POST">
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
xwork.xml you canHave you included the ParameterInterceptor to doTest action in your xwork.xml?
If you <include file="webwork-default.xml"/> in your
use the predefined interceptor defaultStack as:problem is,
<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
thatand write a
setName(... is never called now matter what I do. The doTest() methodshown
below is called correctly.
Thanks for your help, Lars
(BTW documentation still sucks - forget this WIKI thing
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"
value="name"/><table>
<ww:textfield label="Name" name="'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
------------------------------------------------------- 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