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

  • Home
  • SEARCH
  • 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 3441330
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:32:23+00:00 2026-05-18T08:32:23+00:00

Major Update: Due to Spring, the validator is called before the onSubmit invocation occurs.

  • 0

Major Update: Due to Spring, the validator is called before the onSubmit invocation occurs. When no radio buttons are selected, this runs fine. When a radio button is selected, the POST data contains a variable for the radio button and this causes a NestedServletException.

This variable is not bound to any property or class. Is there a “correct” way that such a variable needs to be handled, either within JSP or within my code?


I have a JSP page, hooked up with Spring, where the onSubmit listener is no longer invoked after I add some radio buttons to the JSP page. Without the radio buttons, a bare version of the page looks like this.

<form:form>
    <fieldset>
        <input type="submit" value="Submit"/>
    </fieldset>
</form:form>

This works as expected. My debugger reaches a breakpoint for onSubmit once the submit button is pressed. Then I add the following code for radio buttons, which can be seen below.

<form:form>
    <fieldset>
        <input type="submit" value="Submit"/>
    </fieldset>

    <fieldset class="contentHalfFieldset"><legend>NID</legend>
        <input type="radio" name="someName" value="value1" />
        <input type="radio" name="someName" value="value2" />
        <input type="radio" name="someName" value="value3" />
    </fieldset>
</form:form>

Now, when I don’t select any radio button, the submit button still causes the submission event to reach the breakpoint in the onSubmit method. It still works as intended. However, when I select one of the radio buttons and then press the submit button, the page simply refreshes.

Why is that? What’s happening that makes input buttons prevent the processing of a submission?

——- Generated HTML ——-

<form id="cmd" method="post" action="/page/pageAction.html?param=k" onsubmit="disableSubmit(this);">
    <fieldset class="contentHalfFieldset"><legend>NID</legend>
        <label class="labelClass">First radio button:</label>
        <input type="radio" name="nidStatus" value="first" /><br style="clear: both"/>
        <label class="labelClass">Second radion button:</label>
        <input type="radio" name="nidStatus" value="second" /><br style="clear: both"/>
        <label class="labelClass">Third radio button</label>
        <input type="radio" name="nidStatus" value="third" /><br style="clear: both"/>
    </fieldset>

</form>

——- More Requested Code ——-

This is the disableSubmit(..) method.

function disableSubmit(parentElement) {
    elements = parentElement.elements;

    for(var i = 0; i < elements.length; i++) {
        var element = elements[i];

        if(element.type == "submit") {
            element.disabled=true;
            element.value="Please Wait...";
        }
    }
};
  • 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-05-18T08:32:24+00:00Added an answer on May 18, 2026 at 8:32 am

    Spring tries to bind your variables if they happen to be named as the same thing as your controls (in my case, the radio button). Depending on your code to handle the variable. which you are not intending to bind, an exception can occur before the onSubmit method is reached.

    In my case, I had a class that had a “nidStatus” variable, of an enum type. When the variable “US&nidStatus” (see comments in response to Michael Kopinsky) was sent in the POST action, there was an automatic attempt to bind this. Interestingly, validation went fine before the exception was thrown, so — if you found this question despite someone marking it unacceptable — make sure to check your errors variable in your validate() method, as the handler will still continue on beyond that point as if things are fine.

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

Sidebar

Related Questions

UPDATE: I made major changes to this post - check the revision history for
I'm currently preparing a major Program-Update and ran into following problem: I've got a
I released an update early this morning and my versioning was previously like this:
I'm wondering if anyone has insight into this... when releasing an update of an
I'm having some major issues getting a live tile to update its image via
** MAJOR UPDATE ** I made a minor mistake but I'm still curious about
I have a JQuery/Ajax update. It correctly updates in all major browsers, however, dealing
Major Update after a couple days of debugging: I run a few queries similar
My site was working fine across all major browsers right up until the update
MAJOR UPDATE: I have a PNG fix working on the site. When I remove

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.