Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate MVC Can't create new Client

 
Jose Alvarez de Lara
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new on Hibernate so I am going to explain it as best as I can.

I am trying Coding Advanced DAOs with Hibernate and JPA Annotations - The Pattern,

Cameron McEnzie tutorial, Coding Advanced DAOs with Hibernate and JPA Annotations - The Pattern

What I am trying is to develop it as a web app.

Here is the jsp,



I use a servlet as a controller,



And a Filter to open the org.hibernate.Session and close it every time the transaction is commited.
This filter lets maintain the session opened if necessary. The code is as follows,



This is the code snippet to create a new Client,



But it does not. In fact it creates a new empty records for the tables client, client_detail, address and skill.

And I do not know what I am doing wrong.

Any help will be appreciate!!!

Thanks in advance
Jose
 
Jose Alvarez de Lara
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It was a mistake of mine.

I was using request.getAttribute() instead of request.getParameter()

Regards
Jose
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm glad you discovered the error--I was having a difficult time penetrating the code. You might want to consider writing substantially smaller methods; it helps people understand what's going on.
 
Jose Alvarez de Lara
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Thanks for your suggestion.

I know what you are meaning. Maybe I have posted information that take to confusion
and the methods are quite long.

I will remain it for the next time.


Best Regards,
Jose
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic