Hi all.

I have a HTML form which passes it's data to a JSP, which in turn uses a bean to 
collect the data. I have everything worked out, so far, except one field. The filed in 
question is a boolean property and I'm not sure how to achieve that. I have tried the 
following, with no success (this is a simplified version):

public class MyBean {
  int id;
  boolean print;

  public void setId( int nId ) { id = nId; }
  public void setPrint( boolean np ) { print = np; }
};

---

HTML form

<form name="test" method="post" action="test.jsp">
  <input type="text" name="id" size="20" maxlength="80" value="1">
  <input type="radio" name="print" value="true" checked> yes<br>
  <input type="radio" name="print" value="false"> no
  <input type="submit" name="Submit" value="Submit">
  <input type="reset" name="Reset" value="Reset">
</form>

---

JSP page

---

<jsp:useBean id="dataBean" class="MyBean" scope="page">
  <jsp:setProperty name="dataBean" property="*"/>
</jsp:useBean>

It appears the "print" property is not beaing set by this. I could set it by hand, but 
that's not the point.

How to put up to pair HTML Form and a boolean property of a bean?

Nix.


Reply via email to