This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Custom Tag Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom Tag Issue" Watch "Custom Tag Issue" New topic

Custom Tag Issue

JJ Devine

Joined: Jan 04, 2008
Posts: 2

I have written a custom tag but I am having problems getting it to accept a value, the code in my JSP looks like this:

<mytag:myfunc attr="${item.value}"/>

unfortunately when the value reaches the tag class it becomes the string "${item.value}" rather than the value "value" of the scoped attribute "item". I know the value exists at the time the tag is called because:

<cut value="${item.value}"/>

prints that value to the page as expected. Can anybody help?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61063

As per forum instructions, please disclose the versions of JSP and JSTL that you are using.

It sounds as if you are using an older version of JSP that does not allow the EL in template text, or that your web app is misconfigured.

The JSP FAQ has entries that deal with these situations.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jQuery in Action, 2nd edition
subject: Custom Tag Issue