Do a couple of things as follows :
a) rename ur zipcode variable to zipCode and make the relevant changes in
the bean source file.
b) Also rename zipcode to zipCode in the html fie.

This should solve ur problem.
Have a nice day.
With regards,
Sachin S. Khanna
http://www.emailanorder.com

----- Original Message -----
From: Henry S. Hayden <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 18, 2002 3:24 AM
Subject: JSP/Bean returning a null


> I have a JSP, using a Bean, returning values from an HTML form.  I'm using
> Tomcat 3.3.
>
> So far, I have a very simple form with five fields on the first JSP.  The
> values from the input form are POSTed to the display form.  When
submitted,
> a Bean handles the field processing and sends the values to a second JSP.
> The last page displays all of the results.   The thing that has me stumped
> so far is the fact that only the first four contain values, while the last
> one is displayed as "null."
>
> Here's the Bean:
> =============
>
> package biz_info;
>
> public class Company {
>
>    private String company = null;
>    private String address = null;
>    private String city    = null;
>    private String state   = null;
>    private String zipcode = null;
>
>    // Default constructor
>    public Company() {
>    }
>
>    // Public accessors
>    public String getCompany() {
>       return company;
>    }
>
>    public void setCompany(String theCompany) {
>       this.company = theCompany;
>    }
>
>    public String getAddress() {
>       return address;
>    }
>
>    public void setAddress(String theAddress) {
>       this.address = theAddress;
>    }
>
>    public String getCity() {
>       return city;
>    }
>
>    public void setCity(String theCity) {
>       this.city = theCity;
>    }
>
>    public String getState() {
>       return state;
>    }
>
>    public void setState(String theState) {
>       this.state = theState;
>    }
>
>    public String getZipCode() {
>       return zipcode;
>    }
>
>    public void setZipCode(String theZip) {
>       this.zipcode = theZip;
>    }
>
> }
>
>
> Certainly, nothing very fancy here.  Now, here's most of the JSP display
> page:
> =====================================================
> ...
> <jsp:useBean id="biz_bean" scope="request" class="biz_info.Company"/>
> <jsp:setProperty name="biz_bean" property="*"/>
> ...
>
>    <TR>
>       <TD>Company:</TD>
>       <TD><%= biz_bean.getCompany() %></TD>
>    </TR>
>
>    <TR>
>       <TD Address:</TD>
>       <TD><%= biz_bean.getAddress() %></TD>
>    </TR>
>
>    <TR>
>       <TD City:</TD>
>       <TD><%= biz_bean.getCity() %></TD>
>    </TR>
>
>    <TR>
>       <TD State:</TD>
>       <TD><%= biz_bean.getState() %></TD>
>    </TR>
>
>    <TR>
>       <TD Zip:</TD>
>       <TD><%= biz_bean.getZipCode() %></TD>
>    </TR>
>
> ====================================================
>
> Again, nothing terribly fancy.  I'd appreciate it greatly if anyone can
> point me in the right direction for a solution.  As a test, I've just
added
> another field to the input form, and added the proper methods to the Bean.
> Now the display form displays the company name, address, city, state, and
> phone, with the zipcode still null. I've also added toString to the JSP
> display page, thinking that there was possibly a data-type conversion
> problem, to no avail.  Can anyone tell me what's going on here?  Thanks
for
> your help!
>
>
> Henry
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to