Hi
Property "contractUser" must be boolean in UserForm.java

Hope this helps.


----- Original Message -----
From: "Karl" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 04, 2003 8:20 PM
Subject: Re: Struts not parsing HTML correctly?


2003 3月 4 火曜日 17:58、Nicolas De Loof さんは書きました:
>
> Yout <html:checkbox> is looking for a getter method for property
> contractUser (String getContractUser()) of the current formBean defined by
> a parent <html:form>.
>
> How are you using <html:fom> tag in your JSP ? Is the declared action path
> associated with the correct ActionFormBean in struts-config ?
>

I've implemented your recommendations but it's still complaining =(

I now have the following in user_add.jsp:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
<html:html>
...
            <html:form action="screen_contract_edit.do">
...
                    <tr>
                        <th>Contract User</th>
                        <td>
                            <html:checkbox property="contractUser"/>
                        </td>
                    </tr>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And the following in UserForm.java:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
package com.somewhere.aproject;

...

public final class UserForm extends ActionForm {
...
    /* Contract User */
    private String contractUser = "false";
    public String getContractUser() {
        return this.contractUser;
    }
    public void setContractUser(String contractUser) {
        this.contractUser = contractUser;
    }
...
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And the following in struts-config.xml:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
<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 have other properties in the form as well.  The page works fine with the
rest of the properties (which are all text edit fields), but as soon as I
add
in this checkbox, it starts complaining:

when going to http://localhost:8080/aproject/screen_user_add.do

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


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



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

Reply via email to