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 8103059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:24:58+00:00 2026-06-05T23:24:58+00:00

I am not terribly familiar with either tech, so bear with me. I have

  • 0

I am not terribly familiar with either tech, so bear with me.
I have a set of radio buttons on my jsp page. They are valued 1-5. I would like to update that new rating to the database.
I know that I have to somehow utilize the “onselect” event, but I haven’t found anything that helps.
Does anyone have an idea as how to accomplish this?
Thank you.

  • 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-05T23:25:01+00:00Added an answer on June 5, 2026 at 11:25 pm

    Since you have included spring-mvc in you tags, I am assuming you would like some more information about sending information from client side to the server.

    If your are just using JSP, and a standard form, if you match the ‘commandName’ and the ‘method’ to your controller in spring, the controller will catch the parameters sent through the form:

    <form id="form" commandName="interceptedPath" method="post">
        <input id="rating1" type="radio" name="rating" value="1" checked><label for="rating1">1</label>
        <input id="rating2" type="radio" name="rating" value="2"><label for="rating2">2</label>
        <input id="rating3" type="radio" name="rating" value="3"><label for="rating3">3</label>
        <input id="rating4" type="radio" name="rating" value="4"><label for="rating4">4</label>
        <input id="rating5" type="radio" name="rating" value="5"><label for="rating5">5</label>
    </form>
    
     @RequestMapping(value = "/interceptedPath/", method = RequestMethod.POST)
     public String submit(Model model, HttpServletRequest request) {
         Map<String, String[]> parameterMap = request.getParameterMap();
         String[] strings = parameterMap.get("rating")
         return "detailedCalc";
     }
    

    JavaScript should not be required unless you are doing something dynamic, like Ajax calls. If you do decide to use Javascript I suggest you use the jQuery library:

    $(document).ready(function () {
        $("form").submit(function () {
            $.post('/spring/locationOfAjaxController', $(this).serialize(),
                function (data) {
            }
        }
    }
    

    For the code above, after the document has loaded on the client. An event is created that will catch all ‘submit’ actions on the “form” object (note the id for the form is “form”). Once that occurs jQuery will submit a POST to the specified URL. $(this).serialize() will serialize the form data into JSON, which will need to be handled by the server.

    If you want to do something using change, refer to this reference.

    You can find an excellent example of spring-mvc (without js) using maven archetype: org.fluttercode.knappsack:spring-mvc-jpa-demo-archetype. It will generate a basic project that has spring-mvc already set up and ready to go.

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

Sidebar

Related Questions

Seeking suggestions from PHP architects! I'm not terribly familiar with PHP but have taken
I'm not terribly familiar with NoSQL systems, but I remember reading a while back
After looking around (for not terribly long I have to admit) I wonder if
I'm not terribly well versed with array manipulation in PHP, so I have a
I'm not terribly certain what the correct wording for this type of regex would
Not even sure I'm stating the question correctly. Here's the situation. I have a
I've got to convert a not terribly complicated bespoke project management system from MsAccess
First off, I'm not terribly experienced in XML. I know the very basics of
I'm relatively(read: stupid newbie) familiar with disassembly but this bit stumped me: I have
I'm not terribly good with Javascript so I'm wondering if there is a better

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.