• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pass java Object to taglib

 
Deepa Pillai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to pass a java Object to a taglib but it is passing as string ,
This is the code am using,Please let me know what can be done,

My jsp code <insert:cardType name="<%=cardObjs%>">//where cardObjs is the populated java object

My tld looks like this,
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>

In my java class i have used

public void setName(Object cardobj) {
// cardobj.getClass() shows as string object
if (cardobj!=null && cardobj instanceof Card)
{
this.cardobj= (Card)cardobj;
}
}

Am using jsp1.2 with jdk 1.3.I cannot upgrade either jsp version or jdk.

Please suggest
 
ben hur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this in your web.xml,
----------


<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Prince",
Please check your private messages regarding an important administrative matter.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The Prince ",
Please check your private messages, again.
-Ben
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!