tag-lib and JSTL expression library  
Author Message
luca





PostPosted: 2004-5-5 18:47:00 Top

java-programmer, tag-lib and JSTL expression library Hallo, I have created a tag-lib. They ask me if it integrates
with the JSTL expression library.

In other words, I would like to be able to express this:

<tag attribute="<% = somevar %> "/>

as:

<tag attribute="${value}"/>

any articles/tutorials explaining how to achieve this?

thanks

l.

 
luca





PostPosted: 2004-5-6 19:57:00 Top

java-programmer >> tag-lib and JSTL expression library Hallo, I have created a tag-lib. They ask me if it integrates
with the JSTL expression library.

In other words, I would like to be able to express this:

<tag attribute="<% = somevar %> "/>

as:

<tag attribute="${value}"/>

any articles/tutorials explaining how to achieve this?

thanks

l.


 
Christophe Vanfleteren





PostPosted: 2004-5-6 20:19:00 Top

java-programmer >> tag-lib and JSTL expression library luca wrote:

> Hallo, I have created a tag-lib. They ask me if it integrates
> with the JSTL expression library.
>
> In other words, I would like to be able to express this:
>
> <tag attribute="<% = somevar %> "/>
>
> as:
>
> <tag attribute="${value}"/>
>
> any articles/tutorials explaining how to achieve this?
>
> thanks
>
> l.

If you're using JSP 2.0, you don't have to do anything special to make use
of the JSTL expressions. If you can't do that, you have to build-in support
yourself. Look at how it's done in the Jakarta JSTL tags for an example.

--
Kind regards,
Christophe Vanfleteren
 
 
luca





PostPosted: 2004-5-6 21:48:00 Top

java-programmer >> tag-lib and JSTL expression library

Christophe Vanfleteren wrote:

> If you're using JSP 2.0, you don't have to do anything special to make use
> of the JSTL expressions. If you can't do that, you have to build-in support
> yourself. Look at how it's done in the Jakarta JSTL tags for an example.


Thank you. Actually I am using Tomcat 4.1.18 and that's not JSP 2, is it?
Also, I am building a general purpose tag-library. Are you telling me
that I need to provide two verions of it?
one for JSP 1.2 and one for JSP 2.0?

thanks

Luca

 
 
Christophe Vanfleteren





PostPosted: 2004-5-6 22:06:00 Top

java-programmer >> tag-lib and JSTL expression library luca wrote:

>> If you're using JSP 2.0, you don't have to do anything special to make
>> use of the JSTL expressions. If you can't do that, you have to build-in
>> support yourself. Look at how it's done in the Jakarta JSTL tags for an
>> example.
>
>
> Thank you. Actually I am using Tomcat 4.1.18 and that's not JSP 2, is it?

4.x doesn't support JSP 2 indeed.

> Also, I am building a general purpose tag-library. Are you telling me
> that I need to provide two verions of it?
> one for JSP 1.2 and one for JSP 2.0?

I'm afraid you'll have to if you want to use the EL in JSP 1.2 and still
have your tag be usable with the EL in JSP 2.

The JSTL taglibs also come in 2 flavors for the same reason. But
technically, they are not a JSP 1.2 and JSP 2 version, but one that
supports the runtime expressions and one that doesn't.

--
Kind regards,
Christophe Vanfleteren
 
 
luca





PostPosted: 2004-5-7 0:30:00 Top

java-programmer >> tag-lib and JSTL expression library

Christophe Vanfleteren wrote:
> The JSTL taglibs also come in 2 flavors for the same reason. But
> technically, they are not a JSP 1.2 and JSP 2 version, but one that
> supports the runtime expressions and one that doesn't.

is there any connection between JSP version and
underlying Java version?

luca

 
 
Christophe Vanfleteren





PostPosted: 2004-5-7 2:56:00 Top

java-programmer >> tag-lib and JSTL expression library luca wrote:

>
>
> Christophe Vanfleteren wrote:
>> The JSTL taglibs also come in 2 flavors for the same reason. But
>> technically, they are not a JSP 1.2 and JSP 2 version, but one that
>> supports the runtime expressions and one that doesn't.
>
> is there any connection between JSP version and
> underlying Java version?
>

No, AFAIK you can still run JSP 2 on JDK 1.3 (at least Tomcat 5 should).

JSP 2 is part of the J2EE 1.4 specification though.

--
Kind regards,
Christophe Vanfleteren
 
 
luca





PostPosted: 2004-5-7 5:58:00 Top

java-programmer >> tag-lib and JSTL expression library

Christophe Vanfleteren wrote:

>>I am building a general purpose tag-library. Are you telling me
>>that I need to provide two verions of it?
>>one for JSP 1.2 and one for JSP 2.0?
>
>
> I'm afraid you'll have to if you want to use the EL in JSP 1.2 and still
> have your tag be usable with the EL in JSP 2.

is there a way I can programmatically tell which JSP version I am into
and build a TagLib that works with JSP1.2 and JSP2.0 alike?

Thanks

luca