struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl <k...@webartjapan.com>
Subject Struts not parsing HTML correctly?
Date Tue, 04 Mar 2003 08:51:53 GMT
There are actually 2 problems I'm experiencing:

Firstly, I have the following snippet in one of my forms (user_add.jsp):

                    <!-- tr>
                        <th>Contract User</th>
                        <td>
                            <html:checkbox property="contractUser"/>
                        </td>
                    </tr -->

If this is present, struts fails with the following error:

org.apache.jasper.JasperException: No getter method for property contractUser 
of bean org.apache.struts.taglib.html.BEAN

This happens whether that section is commented out or not, but does not occur 
if I remove the code entirely.


The second problem is that I actually DO have a getter (and setter) method for 
contractUser in UserForm.java:

    /* Contract User */
    private boolean contractUser = false;
    public boolean getContractUser() {
        return this.contractUser;
    }
    public void setContractUser(boolean contractUser) {
        this.contractUser = contractUser;
    }


I have the following in my struts config:

<struts-config>
    <form-beans>
...
        <form-bean name="userForm"
                   type="com.somewhere.aproject.UserForm" />
...
    </form-beans>
    <action-mappings>
...
        <action path="/screen_user_add"
             forward="/user_add.jsp"
                name="userForm"
            validate="false"/>
...
    </action-mappings>
</struts-config>


I know the configuration is right since the rest of the fields work fine.  
Should I be using type String instead of boolean for contractUser?


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message