You could define your own custom function.
See bottom of page at
http://java.sun.com/j2ee/1
Main Topics
Browse All TopicsI need to parse out the Class name from a dot-delimited Class identifier in a JSTL variable.
ie: from ' java.lang.NullPointerExcep
Typically, I'd use something like '${exception.substring(exc
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You could define your own custom function.
See bottom of page at
http://java.sun.com/j2ee/1
Not terribly difficult, but not trivial, either. Typical Sun documentation - not clear and somewhat ambiguous.
I wrote the function, compiled it, packaged it in a jar file and put it in the lib folder under WEB-INF.
Edited web.xml to tell Tomcat about it.
Added taglib declaration in JSP.
Ran it and got:
"The function lastIndexOf cannot be located with the specified prefix"
Saw something about taglib handlers. Is that required?
I think you are confusing "custom tag" with "custom function".
First no editing of your web app's web.xml file is necessary. Here is how I did it. My code is below here.
I created a file called myFunctions.tld and placed it into my web app's WEB-INF folder.
I created a file called Basename.java and compiled it.
I placed Basename.class into a folder called rrz and placed that into my web app's classes folder.
On my JSP I have
<%@taglib prefix="my" uri="/WEB-INF/myFunctions.
<c:set var="exception" value="org.springframework
Exception is ${my:basename(exception)}
I guess the really confusing part of this is that the function name is what appears in the EL on the JSP.
EL looks for that named function in the tld and uses the listed method signature to find the correct method in the class file.
To make it easier, I just use the same name for the function and for the method (basename in this case).
I got it running for a single method in my tld library, but when I added a second method to the class, I get an error that it cannot find the second method (even though it precedes the first method I wrote and THAT method IS found and executed ok.?!?!)
I edited the web.xml so my JSP tld declaration looks like a standard URL - http:softechnics.com/softr
In your jar, did you place your tld file inside of a META-INF folder ?
See paragraph " Auto-Discovery of Tag Libraries" at
http://onjava.com/pub/a/on
Business Accounts
Answer for Membership
by: dravidnsrPosted on 2009-09-02 at 11:03:22ID: 25243758
can u post the error code??