struts2 html checkbox not pre-checked

    <h3>Register for a prize by completing this form.</h3>
    <s:form action="register">
          <s:textfield name="personBean.firstName" label="First name" />
          <s:textfield  name="personBean.lastName" label="Last name" />
          <s:textfield name=""  label ="Email"/>
          <s:textfield name="personBean.age"  label="Age"  />
          <input type="checkbox" checked="checked" />
    <input type="checkbox" checked="checked" />

I have a jsp with above content. The checkbox within the form is not checked whereas the checkbox outside form is pre-checked. I am mixing up plain html checkbox and non-html elements within a struts form.

Source: jsp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.