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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:37:00+00:00 2026-06-17T08:37:00+00:00

I am working on spring API with postgres, I want to create form in

  • 0

I am working on spring API with postgres, I want to create form in jquery with few animations and I want to submit the form data to a database table. Is there anyway without using the spring form? or can I add the jquery ajax calls actions to the spring form?

My jquery page works fine with the all the ajax autofill correctly as a stand alone. But I want to integrate now with the spring so that when I submit the form the data is posted to the DB using hibernate.

Is it possible to use the same jquery page in the spring? Can anyone suggest something pls?

    @RequestMapping(method = RequestMethod.GET)
public ModelAndView getVisitor() {

    return new ModelAndView("visitor", "command", new Visitor());
    // return "visitor";
}

@RequestMapping(method = RequestMethod.POST)
public String addVisitor(@ModelAttribute("visitor")Visitor visitor,
        ModelMap model) {
    System.out.println(visitor.getComment());
    String resp = visitorService.add(visitor);
    return resp;
}
}

I have this in my controller, once I submit my form, it is trying to post to addVisitor but the visitor object is null.

<form action="visitor" method="post" class="fancy-form">

        <div class="">
            <input type="text" maxlength="50" id="name" name="name" /><label
                for="name">Name: </label>
        </div>
        <fieldset name="address">
            <legend>Address</legend>
            <p class="instructions">Start by entering your zip code.</p>
            <div>
                <div>
                    <input type="text" name="street1" id="street1"><label
                        for="street1">Street #1</label>
                </div>
            </div>
            <div>
                <div>
                    <input type="text" name="street2" id="street2"> <label
                        for="street2">Street #2</label>
                </div>
            </div>
            <div>
                <div class="city-wrap">
                    <input type="text" name="city" id="city"> <label
                        for="city">City</label>
                </div>
                <div class="county-wrap">
                    <input type="text" name="county" id="county"> <label
                        for="county">County</label>
                </div>
                <div class="state-wrap">
                    <input type="text" name="state" id="state"> <label
                        for="state">State</label>
                </div>

                <div class="zip-wrap">
                    <input type="text" pattern="[0-9]*" maxlength="5" required
                        name="zip" id="zip"> <label for="zip">Zip</label>
                    <p class="zip-error">Not a real zip code.</p>

                </div>


            </div>

        </fieldset>
        <div>
            <input type="button" id="go" value="Find Me" />
        </div>

        <div class="">
            <label for="comment">Comment: </label>
            <textarea id="comment" name="comment" rows="4" cols="50"
                maxlength="2000">Enter comment here...</textarea>
        </div>
        <div>
            <input type="submit" value="Submit" />
        </div>
    </form>
  • 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-17T08:37:00+00:00Added an answer on June 17, 2026 at 8:37 am

    Have you serialize your Form data?

    $.ajax({type:'POST', url: 'post_action_url', data:$('#FormId').serialize(), success: function(response) { 
    //response here
    }});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on Spring-Hibernate-Websphere application and sybase as database. Following is the code
I am working on a REST api using Spring-MVC and json. I running my
Working with Query API from DynamoDB. Entities table has hash-and-range primary key. Range column
I am working on Google Calendar API. Whenever I create any event and enter
I am working with twitter api data and after storing the stream results in
I'm working on a web application with a Spring Roo REST API backend and
I am working on a API to access data stored in a system. The
I'm currently Working on a GWT 2.4 / Spring 3 application and want to
I am working on a project using Java and Spring 3. There is a
I'm working with JMS API (with HornetQ) and i'm using spring beans for message

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.