• Post Reply Bookmark Topic Watch Topic
  • New Topic

taglib should get Object from a bean  RSS feed

 
schnullerbacke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!