This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes dynamic value for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "dynamic value for "class" attribute of jsp:useBean" Watch "dynamic value for "class" attribute of jsp:useBean" New topic

dynamic value for "class" attribute of jsp:useBean

sonali jingar

Joined: Mar 01, 2013
Posts: 2
I am working in finance module i need to know wheteer value for "class" attribute in jsp:useBean tag can be set dynamically..
ie . if
branch is 1 then id='X'
<jsp:useBean id="dbprd" class="<%=session.getAttribute(id)%>" scope="application"/>
else id =' y'
<jsp:useBean id="dbprd" class="<%=session.getAttribute(id)%>" scope="application"/>
is it possible to set dynamic value for "class" attribute.

please help.....
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60074

Not possible.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: dynamic value for "class" attribute of jsp:useBean
Similar Threads
Doubt in jsp:setProperty tag
Value for the useBean class attribute is invalid -- why?
jsp:useBean Topics
Session.removeAttribute doesnt work
Dynamic "id=" attribute for jsp:useBean?