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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:52:03+00:00 2026-06-11T20:52:03+00:00

There is a jsp which outputs a HTML5 page. The HTML5 has two buttons

  • 0

There is a jsp which outputs a HTML5 page. The HTML5 has two buttons – “Add” and “Save”. HTML5 local storage feature is used to store offline data.

“Add” button adds a record when clicked. So if user fills the fields on the jsp page 5 times and clicks the “Add” button 5 times, 5 records are added to the HTML5 table. When “Add” button is clicked, a javascript is run which adds the record to a result set. So for 5 clicks the javascript result set contains 5 records.

“Save” button, when clicked, must insert all the 5 records from the javascript result set to the Oracle database. To do this the list of records from result set must be passed to the Spring controller.

The Spring controller has been coded using batchUpdate api.

public void insertListOfPojos(final List<MyPojo> myPojoList) {

    String sql = "INSERT INTO "
        + "MY_TABLE "
        + "(FIELD_1,FIELD_2,FIELD_3) "
        + "VALUES " + "(?,?,?)";

    getJdbcTemplate().batchUpdate(sql, new BatchPreparedStatementSetter() {

        @Override
        public void setValues(PreparedStatement ps, int i)
            throws SQLException {

            MyPojo myPojo = myPojoList.get(i);
            ps.setString(1, myPojo.getField1());
            ps.setString(2, myPojo.getField2());
            ps.setString(3, myPojo.getField3());

        }

        @Override
        public int getBatchSize() {
            return myPojoList.size();
        }
    });

}

The question is – How do you pass the records from the javascript result set to the Spring controller so that it is available to controller’s “myPojoList” when the “Add” button is clicked?

  • 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-11T20:52:04+00:00Added an answer on June 11, 2026 at 8:52 pm

    I have couple of thoughts

    1. Form that 5 records into a json string and post to the controller and unmarshall the json to object and store in Oracle.

    2. Form that 5 records to a delimited string some thing like id1,name1,address1|id2,name2,address2..etc. In the server side you can tokenize and store in the Oracle.

    JSON has standard format so that will be better option. The javascript that is used to store in HTML5 can be used to form this string in the client and once submit read from the client and push to the controller.

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

Sidebar

Related Questions

There is a JSP page in which i have an ArrayList variable. I need
I have a JSP page where there is a row of buttons in their
A jsp page in which dynamic datas are there. I want to get the
I am creating an user registration form using jsp,in which there is an option
Is there a way in JSP to know the current page name (not the
In a JSP page, there is such code: <jsp:useBean id=checklog class=com.google.admin.guard.CheckLogBean scope=session /> and
I've a jsp page which saves a request parameter inside a javascript variable. Say
I have a jsp page which contains the code which prints all files in
I have a dynamic page (say myFlashContainer.jsp) which renders different Flash content based on
I have created a jsp page which run fine when executed in tomcat.But when

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.