Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / May 2004

Tip: Looking for answers? Try searching our database.

tag-lib and JSTL expression library

Thread view: 
luca - 06 May 2004 12:56 GMT
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 - 06 May 2004 13:18 GMT
> Hallo, I have created a tag-lib. They ask me if it integrates
> with the JSTL expression library.
[quoted text clipped - 12 lines]
>
> 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.

Signature

Kind regards,
Christophe Vanfleteren

luca - 06 May 2004 14:48 GMT
> 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 - 06 May 2004 15:05 GMT
>> 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.

Signature

Kind regards,
Christophe Vanfleteren

luca - 06 May 2004 17:29 GMT
> 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 - 06 May 2004 19:55 GMT
>> 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.

Signature

Kind regards,
Christophe Vanfleteren

luca - 06 May 2004 22:58 GMT
>>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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.