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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:36:26+00:00 2026-05-24T17:36:26+00:00

I have an html/jsp form that I am serializing(using jquery) and passing to a

  • 0

I have an html/jsp form that I am serializing(using jquery) and passing to a spring controller via ajax. In fact it is a spring-mvc form that is bound to an attribute.

My first question is: as I am passing the data from the form via ajax this binding is not relevant ?

Secondly, the object it is bound to is quite a complex hibernate entity object and I am experiencing problems converting the json to an instance of the object – it has references to other objects etc etc, well actually I am not sure what the exact problems are as the error message is not particularly clear: Content type ‘application/json’ not supported.

Should I use a DTO/value object instead of the entity object, and then create an entity object based on the DTO?

Or, should I track down the problem fields in the entity object/form that are causing the json conversion to fail , this will be time-consuming and dull, but the end result seems to me to be neater.

Suggestions welcome.

edit:
Conversion of simple forms/objects is working fine when they just have a couple of string properties and related getters/setters. The controller and javascript code.

  • 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-24T17:36:27+00:00Added an answer on May 24, 2026 at 5:36 pm

    Yes, use a DTO. Apart from avoiding the various ORM issues that you’re experiencing, it will make it much easier for you to define what you do and do not want your users to be able to change. For example, what if someone sent you a hacked JSON object that defines a property or relationship that you didn’t want them to be able to modify? How prepared are you to perform (and maintain) checks on every property on that model object to avoid such hacks?

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

Sidebar

Related Questions

I am using Ajax in a jsp page wherein we have a form of
I have a simple jsp form that the customer uses to send us emails.
Hello i have a JSP page that contain a form, i want to validate
i have made a small web application with form.html output.jsp ServletOne.java In the form.html,users
Here's my issue: I have a html form that after a user fills in
I have a jsp page(let's say page1.jsp) which have an html form with action=page2.jsp.
I have a web app with spring,jsp and jquery in a apache tomcat 6,
I have a jsp which contains a html form. Inside it there is an
I am using spring MVC 3. I have been trying to access the attributes
I have to create a simple form that uses JSP for the view with

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.