I tried to "echo print" the value of the PostalCode after it has been picked
up by the bean, by calling <jsp:getProperty name="FormHandler"
property="PostalCode"/>.  And I get an error message stating :

org.apache.jasper.JasperException: Cannot find any information on property
'PostalCode' in a bean of type 'com.complusdata.beans.FormBean'

When I complete the Form, I type in 12345 in the input box and yet it seems
as if the value of PostalCode is "lost" in the bean.  

Any thoughts?  

Denise Mangano
Help Desk Analyst
Complus Data Innovations, Inc.


-----Original Message-----
From: Denise Mangano [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 02, 2003 1:46 PM
To: 'Tomcat Users List'
Subject: Code works in editor, but not through Tomcat - Please help!
Importance: High


Hi all.  This one's kind of urgent because its holding up the rest of my
project...

I'm not sure I understand why this is happening. I have a bean that I use
for form validation.  When I test the code locally using an editor and hard
coding variable values, the code runs perfect and all information is
validated (i.e. check zip code length =5, check zip code is a number, check
credit card number is a number, check all fields are filled in etc").
However, when I try to validate my form through Tomcat I keep getting errors
on the same fields over and over.

Any idea why this would be happening?  I have posted my code below just in
case, but since it worked when I ran it in the editor, I do not think the
problem is my code.  The only thing I can think of is that somehow,
something screwy is happening when my bean properties are being set....

Thanks in advance!
Denise

Errors (only get these over Tomcat):

I enter 12345 as zip code, and I get "Please enter a valid zip code." error
message (The second error only comes up when I try a non numeric zip so that
part works ok). Input type is text and bean variable is string. The Code:
             if (PostalCode.equals("") || PostalCode.length() != 5 )
            {
                errors.put("PostalCode","Please enter a valid zip code.");
                PostalCode="";
                allOk=false;
            }
            else
            {
              try {
                int x = Integer.parseInt(PostalCode);
              } catch (NumberFormatException e) {
                errors.put("PostalCode","Please enter a valid 5 digit zip
code.");
                PostalCode="";
                allOk=false;
              }
            }

I enter 12/03 for Expiration date, and keep getting invalid message.  Input
type is text, and bean variable in bean is a String. The Code:
        if (Expires.equals(""))
            {
               errors.put("Expires","Please enter expiration date as
MM/YY.");
               Expires="";
               allOk=false;
            }

I try [EMAIL PROTECTED] for both email and retype email.  Input type is text
and bean variable is string. Here is the code:
    if (Email.equals("") || (Email.indexOf("@") <= 0))
    {
        errors.put("Email","Please enter a valid email address.");
        Email="";
        allOk=false;
    }
    else if (!Email.equals(retypeemail))
    {
        errors.put("Email","The emails entered do not match.");
        Email = "";
        retypeemail="";
        allOk=false;
    }

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

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

Reply via email to