Hi all,

using 4.1.12 - is there any issues with setProperty()

I have a simple form with 3 textfields (1 shown in example below for clarity) and a 
java bean class (again cut down 1 method).

problem - the bean does not get populated when I hit submit (ie) when I call 
getFname() from addUserA.jsp its null.  When I reload the html the form also resets 
(ie) fields do not retain their value


thanks

Thomas








addUser.jsp
-----------------

<html>
<body>

<jsp:useBean id='form' class='login.bean.AddUserForm' scope='request'>
  <jsp:setProperty name='form' property='*' />
</jsp:useBean>

<form name="form" method="post"  action="addUserA.jsp">
  <table width="50%" border="0" align="center">
    <tr class=heading><td class=heading colspan="2"><h3 align="center">Please enter 
the users details</h3></td></tr>
    <tr>
      <td width="25%"><b>First Name</b></td>
      <td width="75%"><input type="text" name="fname" maxlength="50" size="50" 
value='<%=form.getFname()%>'></td>
    </tr>
    <tr>
      <td colspan="2" height="50">
        <div align="center"><b><input type="submit" name="Submit" value="Add 
User"></b></div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>



AddUserForm
--------------------

package login.bean;

public class AddUserForm
{

  public String getFname()
  {
    return fname != null ? fname: "";
  }
  public void setFname(String fname)
  {
    this.fname = fname;
  }

  private String uname;
}













---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to