• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Hibernate MVC Can't create new Client

 
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
 
Author
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
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic