• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pls help me to clear this problem!

 
xiaoma wang
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone:
I tried to test a jsp using taglib and I am confused by the result. The following is my jsp file:
<jsp:useBean id="test" class="sunwebapp.trying"/>
<he:heading color='<%=test.toString()%>' fontSize="40">My Name is Anand </he:heading>
What i want to do is to assign the "test" of class sunwebapp.trying to the attribute "color", but "color" is always empty. You know, I have already overriden the toString() method of trying class. Why this happen? I can not assign the attribute using java bean instance or even another taglib?
Thanks in advance!
Xiaoma Wang
 
Akbar Basha R
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In the TLD, for the attribute color, you should add the element <rtexprvalue> with a true value.
If you dont add this, then color attribute, would not be evaluated at run time.
-Akbar
 
xiaoma wang
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, Akbar:
I tried the program under your advice and it works fine. Thank you!
Another question: can i assign a tag library result to the attribute value? I tried sereral times, but it is always empty! No compile error.
Xiaoma Wang
 
Akbar Basha R
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can you send me the piece of code, so that i can try and let u know.
-Akbar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic