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

JSP and JSF interaction  RSS feed

 
heath carlough
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSF page which is using some beans. Now how do I access these beans inside a JSP tag? Do I have to use the <jsp:usebean/> tag or can I use some other way to reference bean properties from inside the jsp tags?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need to do this?
 
heath carlough
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The examples in my faces has something like this




Seems like the tree is initialized in a jsp tags and then the jsf taglib is used to reference the tree. How can I use a jsf bean inside the jsp tags to create the tree??
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is very bad design. You should create the tree in your backing bean and then reference that in JSF on your JSP page.



And then the JSF tags should work as they already are. JSF will automatically put a reference to the DefaultTreeModel in whatever scope you specify for your backing bean with the bean name of treeModel.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!