Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how does data from a jsf (xhtml) form get mapped to objects that are in the managed bean?  RSS feed

 
simon arriola
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I am a newbie at using the java ee 6 technologies. I just want to ask how do xhtml (or jsf) form controls like this



get the value accross the managed bean??

I am trying to experiment with it and I can't seem to pass any value to the managed bean which holds the entity object that I wish to persist. It always comes up with null values, even though my jsf page are written the same as above.

as of now I am trying to learn the code generated by netbeans ide and its input fields seems to have a condition. if the entity is null, create one, if it is not, return the previously created.

so it gets accessed like this



the condition would either return a newly instantiated entity or the previously created one, I am trying to do it myself but I can't seem to make it work. So I just want to know when do the managed beans get created? when do the entities inside the managed beans get created? Do I have to create it manually? or does it get created automatically by the container

please shed some light.

any suggestions would be appreciated.
 
Andrew Moko
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you need to manually create an instance of the entity bean on the managed bean, and have the corresponding getters & setters.
 
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!