aspose file tools*
The moose likes Servlets and the fly likes jsp:usebean - deciding which bean at run time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp:usebean - deciding which bean at run time" Watch "jsp:usebean - deciding which bean at run time" New topic
Author

jsp:usebean - deciding which bean at run time

Steven Briggs
Greenhorn

Joined: Jul 20, 2001
Posts: 6
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

Joined: Feb 25, 2001
Posts: 77
Why not ? Try this
<% if (condition) { %>
<jsp:useBean .......>
<% } else (condition) { %>
<jsp:useBean .......>
<% } %>
Steven Briggs
Greenhorn

Joined: Jul 20, 2001
Posts: 6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp:usebean - deciding which bean at run time
 
Similar Threads
q on jsp:useBean
retrive serialize files data ERROR
Cannot open JSP page
jsp:useBean tag
jsp:useBean