• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring,Hibernate Integration Question?

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to send my form data to mysql database using Hibernate.I made a mysql database called hibernatedemo with student table which has fields id,name,email.
This @RequestMapping("AddContactOK") code is not working properly.can you explain a way to correct the below code
(//save data in mysql? place in first code set)
This is my code in Add.java in controller class


This is data in student class



This is my code in Contact.java


This is my code in HibernateUtil class




 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually the problem you are having is not related to Hibernate at all.

@RequestMapping takes the URL that you want to map to that method.

so

"AddContact" to me would mean

www.mysite.com/myWebContextNameForMyApp/AddContact

is the URL. I always forget if you are required to have a "/" in front of your string or not like

"/AddContact"

Hope that helps

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic