• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:usebean - deciding which bean at run time

 
Steven Briggs
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to be able to use the same jsp page to load different JavaBeans from session scope (using jsp:usebean), depending on the value of a parameter in the session.
I can't put the jsb:usebean tag inside an if statement - any ideas?
Steven
 
Sunetra Saha
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not ? Try this
<% if (condition) { %>
<jsp:useBean .......>
<% } else (condition) { %>
<jsp:useBean .......>
<% } %>
 
Steven Briggs
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha, I knew it would be something obvious! Thanks for your patience with me, a simple, tired and thoughtless fool. I'd not closed off the %> of the if statement before beginning the jsp:usebean tag.
Thanks
Steven
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic