• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

taglib should get Object from a bean

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi folks

I'm very new too Java / JSP and don't know much about object oriented programming and this stuff. Please explain everything very noobish

Here the situation:
For learning Java / JSP I want to program a little addressbook. The user data (name, firstname, ...) should be stored in a database, which I acces with hibernate. With hibernate is everything ok.

I've a form in a jsp page (index.jsp) which calls another jsp (savedata.jsp). Savedata.jsp saves the data from the form in a POJO (I think it's called like this) named Address. Now I want to get the data entered in the form from Address. For this I implemented a taglib (SaveData.java) which is called from savedata.jsp. I think I have to work with sessions to get the data from Address, but not the SessionFactory from Hibernate, right? But how to access the data in Address from the taglib?

Because I'm soo noob, the whole structure could be senseless. I'm open for suggestions.

Thanks in advance for help,
schnuller


Here some code:

index.jsp


savedata.jsp


Address.java


SaveData.java
 
Marshal
Posts: 75620
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Major problem with that application. It is far too large for a raw beginner. Start small. Write an Address class, a Name class, (you already appear to have a Name class, but you have called it Address!) and program a Person class with name and address fields. Get that running.

Get the database running, then see if you can link the two together. If you really are a raw beginner, that will take a few days to learn. Find the Java� Tutorials, and their section about databases.
 
schnullerbacke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Campbell,

thanks for your fast reply. I already got some experiences with Java. Already I can create new objects and get their attributes and this stuff. I also read some tutorials and I can follow them, because they are very easy. Now I wanted a more complex example on which I can train my "architecture" abilities. In my opinion it's quite hard to "design" my own program. So I would like to stay at this example and develop it.

But thanks for the proposal!
 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic