wood burning stoves 2.0*
The moose likes JSP and the fly likes Pass expression value to custom tag class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Pass expression value to custom tag class?" Watch "Pass expression value to custom tag class?" New topic
Author

Pass expression value to custom tag class?

Gaurav P Goel
Greenhorn

Joined: Oct 25, 2006
Posts: 4
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

Joined: Feb 23, 2009
Posts: 1183
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.


JDBCSupport - An easy to use, light-weight JDBC framework -
cary grant
Greenhorn

Joined: Jan 06, 2010
Posts: 1
You could also try setting <%@ page isELIgnored=false %> in your JSP file and see if that works.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61456
    
  67

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

Joined: Jan 10, 2002
Posts: 61456
    
  67

"cary grant", please check your private messages for an important administrative matter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pass expression value to custom tag class?