assuming you have some manner of userForm extending actionForm
public class userForm extends ActionForm
{
//accessors
//mutators
//reset
//validate
};
//and then have an Action Class coded somthing like
public class userAction extends Action
{
//execute method
};
//struts-config.xml will need a definition for the form in struts-config.xml
<form-bean
name="userForm"
type="package.userForm"/>
//create the Action based on name of userForm
<action
     path="/user"
     type="package.userAction"
     name="userForm"
     scope="request"
     validate="true"
     input="/user.jsp">
    <forward name="success" path="/pages/success.jsp"/>
</action>

//so looking at html:text
<html:text takes property="NameOfPropertyInBean" size=20 Maxlength=30 
value="dto.getInitialValueOfPropertyInBean()"/>
size is initial size
maxlength is maximum length
value is initial value

property is the property from the bean
name indicates the name of the field from the form
Im not sure why you are using both name and property (when one will do..)

Anyone else?
M--
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Sunday, March 18, 2007 1:31 AM
Subject: Struts Form Values are null


> Hello, 
> I have a form called as UserForm(UserForm.java ) and a 
> UserAction(UserAction.java) configured in the struts config for the dispatch 
> action method named getUserDetails.The UserForm has a property called as 
> userID. 
> 
> My JSP Code is 
> 
> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html"%> 
> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic"%> 
> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean"%> 
> 
> <html:form styleId="userForm" 
> action="/DisplayUserDetails.do?method=getUserDetails" 
> method="POST"> 
> <html:text name="userForm" property="userID" 
> styleClass="usertextbox"></html:text> 
> <html:submit value="GO" styleClass="buttonedit"></html:submit> 
> 
> </html:form> 
> 
> This HTML form is a part of a tile layout.When I submit the form ,the userID 
> value in the getUserDetails method of the UserAction Class is found to be 
> null..Is there any reason for the userID to be null ????? 
> 
> I have the correct form bean mapping and action mapping in the struts config 
> and also the getters and setters for the form properties are correct.Can U 
> let me know why the form values are null on submit ??? I also tried 
> submitting the form using Java Script and still the form values are found to 
> be null..My Struts version is 1.3.5 
> 
> Any Clues??? 
> 
> Thanks in Advance .. 
> Ram
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to