This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes USEBEAN tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "USEBEAN tag" Watch "USEBEAN tag" New topic
Author

USEBEAN tag

kundan varma
Ranch Hand

Joined: Mar 08, 2004
Posts: 323
Hi All
I want to assign dynamically class or Type in the UseBean tag.
Is it possible?

My code:

code 1 ---- is

<% long SubDeptCode = (Long.parseLong(request.getParameter("subDeptFk")));


if(SubDeptCode==1) {
%>
<jsp:useBean id="testForm" class="cal.xxxForm" scope="request"/>
<jsp:setProperty name="testForm" property="*"/>

<% } else if(SubDeptCode==2) {

%>
<jsp:useBean id="testForm" class="cal.yyyForm" scope="request"/>
<jsp:setProperty name="testForm" property="*"/>

or else if i can do like this
code 2:----
<jsp:useBean id="testForm" class=<%=varClassNmae%> scope="request"/>
<jsp:setProperty name="testForm" property="*"/>

Is This possible or if any alternate solution to dynamically assigning class type in JSP usebean tag.

Thanks
kundan


SCJP1.4,SCBCD,SCEA,CNA
Failures are practice shoots for success.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: USEBEAN tag
 
It's not a secret anymore!