Preparing JSP Taglibrary for JSTL and EL

I have a taglibrary I've been working on that generates live GoogleMaps using 100% java (no javascript or AJAX needed by the developer). I would like to incorporate this library within JSTL, so users can place the GoogleMaps tags within JSTL tag (i.e. sql tag and c tags) so they can generate maps using database data to add markers, etc.

Is there any special preparation needed to allow tags to accept EL as attribute values or is this built-in?

Thanks in advance. I'm not a big JSTL user or I would have generated a test page myself.

[556 byte] By [linxpdaa] at [2007-10-2 15:09:32]
# 1

You need to allow your tags to accept EL?

In a JSP2.0 container (eg Tomcat 5) it is built in. ${expr} is a runtime expression just like <%= expr %> is. So if you can use <%= expr %> with a tag, you can use ${expr}. As long as you have a JSP2.0 container (eg Tomcat 5) and have enabled the EL (by having your web.xml defined as being version 2.4)

For older apps, still in Servlet2.3/JSP1.2 you couldn't use EL without modifying the tags. You would have to provide the EL evaluator yourself (there is one in jakarta commons) and evaluate each attribute using that manually. Effectively it is a complete duplicate set of tags just for EL.

Struts-el is one example. Also JSTL1.0 had standard and rt versions for using ${expr} and <%= expr %> respectively with the tags.

Does that answer your question?

evnafetsa at 2007-7-13 14:04:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yes it does. Thank you. Now I'll have to start learning JSTL (I've always favored avoiding that, but the target audience of my tag library will probably want it) so I can demonstrate the functionality using sql and c tags.
linxpdaa at 2007-7-13 14:04:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

> Yes it does. Thank you. Now I'll have to start

> learning JSTL (I've always favored avoiding that, but

> the target audience of my tag library will probably

> want it) so I can demonstrate the functionality using

> sql and c tags.

Out of interest, why do you avoid JSTL?

angrycata at 2007-7-13 14:04:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

While JSTL is a big step above scriptlets, I still prefer to use custom tag libraries. If you were to look at any of my websites (of which I administer 4 for a grand total of some 1000s of pages) there are no scriptlets or JSTL anywhere. Just standard JSP tags.

While this takes some additional time up front, non of my webpage guys knows a single thing about java, yet they can create these way cool interactive pages just by writing pages using the custom tag libraries we've created. If there's a problem on a page I know immediately where it is. I'm not debugging JSTL or scriptlet code just to find out the problem was in the tag, or vice versa.

It's just a personal thing.

linxpdaa at 2007-7-13 14:04:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...