Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:06:24+00:00 2026-06-07T21:06:24+00:00

I have a very simple issue. Below is my JSP code , where I

  • 0

I have a very simple issue. Below is my JSP code , where I display multiple check boxes in rows. By default all checkbox are checked, and if user wants to ignore certain row, he unchecks that row’s checkbox.

My issue is, if a row’s checkbox is unchecked and because of some other fields, if Struts throws a form validation error on screen, the unselected checkbox is displaying back as checked. Am I missing something? If no struts validtion, then everything looks correct.

<c:forEach var="map" items="${form.displayList}" varStatus="index"> 
    <html-el:checkbox styleId="someCheckbox_${index.index}" property="someCheckboxes[${index.index}]"  />
     <td> .....</td>
     <td> .....</td>
     <td> .....</td>
</c:forEach>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:06:25+00:00Added an answer on June 7, 2026 at 9:06 pm

    When you submit data to Struts the following things happen:

    • Struts has a front controller and all request are going through this controller. This is the ActionServlet class which then based on what was configured in struts-config.xml passes the request to the appropriate Action class.
    • before that happens, an ActionForm instance is constructed or reused if it’s a session saved form;
    • reset() is called on the ActionForm. This is where you reset checkbox properties to false. This is needed because unchecked HTML checkboxes are not sent on the request when you submit, so Struts does no request data binding for them (if they were checked when you loaded the page they remain checked even if the user unchecked them on submit);
    • the ActionForm is populated with the request data (any checked checkboxes are now checked, the ones who were not sent on the submit remain unchecked because of the previous reset);
    • the ActionForm’s validate() method is called if so specified in struts-config.xml;
    • if validation fails, the control is returned to the input JSP if so specified in struts-config.xml (the submitted data is what the page will display because it’s on the ActionForm);
    • if instead validation is successful, the execute() method on the Action class is called;
    • Action class does it’s job and forwards to some JSP.

    Is this how you are using Struts? My guess is you are doing some populating/resetting/validations in the Action class and when validation fails you reload the ActionForm with the default data.

    Check your ActionForm for the reset() and validate() code and your Action class for execute() and see where the data is getting checked back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some very simple code below that I can't get to validate on
I have a very large ASP.NET application in C#. The issue is simple yet
I have very simple piece of code. The goal is when i input four-digit
I have a very simple fxml file, with a checkbox: ... <AnchorPane id=AnchorPane xmlns:fx=http://javafx.com/fxml
I have a very simple unidirectional mappings. see below: public ContactMap() { Id(x =>
I have very simple OpenGL ES example similar to Hehe's example : http://nehe.gamedev.net/tutorial/ios_lesson_02__first_triangle/50001/ As
I have very simple window where I have 2 buttons - one for cancel,
I have a very simple table called Member , which consists of the following:
I have a very simple Mapping I'm trying to do. I'm following the NHibernate
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.