Hi,

I am facing the following issue with regard to jsp form initialization by
struts
When a primitive data type such as int or double is used in the form bean ,
the corresponding jsp shows the
form elment initialized to 0 or 0.0 as the case may be.
         How do i prevent this from happening ?

However if the form bean attribute carries a valid value (say 5 or 6.56 etc)
, then the same must be displayed on the jsp.


Let me enumerate with an example

Suppose the form bean look like this

        FromBeanA.java
        {
                double age ;

                public void setAge(double age)
                {
                this.age = age;
                }

                public double getAge()
                {
                        return this.age
                }
        }

--- And the jsp has the following

<html:form action="/xyz.do" >
--------------
-----------
<!-- here form bean is assumed to be appropriately configured -->
Age =   <html:text name="FromBeanA" property="age" />


<html:form/>

then  the display of the jsp will look like this

                Age = 0.0

I do not want 0.0 to appear


Thanks in advance,

        Prakash













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

Reply via email to