Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass expression value to custom tag class?

 
Gaurav P Goel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have developed a custom tag java class. It takes a string and processes it to output another string.
e.g. £215 is returned as £215

In jsp, previously i used

Now i have to use the new tag which i have developed. So i need to pass the above value to the class file.
I am passing it as follows:

I am expecting that i would get something like £215 in java class. But after debugging i found that it is getting ${project.value} and not the actual value.

This is my TLD file:

Can anybody help me in pointing out how to achieve this?
Thanks.>
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You forgot /> in the second tag but I guess you've got that correct in the real code.

Try to simply write out ${project.value} and see if the value is there to begin with. Maybe EL is disabled by some miracle.
 
cary grant
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also try setting <%@ page isELIgnored=false %> in your JSP file and see if that works.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cary grant wrote:You could also try setting <%@ page isELIgnored=false %> in your JSP file and see if that works.


That is completely unnecessary if the web app is configured properly.

I notice that your TLD is for JSP 1.2. Are you running in a JSP 1.2 environment? JSP 2.0? JSP 2.1?

Without further information, we can;t tell if your app is properly configured or not.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"cary grant", please check your private messages for an important administrative matter.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic