• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

pls help me to clear this problem!

 
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
 
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
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic