Skip to main content

JSTL diferences in GlassFish V3

3 replies [Last post]
rdelaplante
Offline
Joined: 2007-04-01

Hi,

I'm working on migrating from GlassFish V2.1 to GlassFish V3. One of the migration issues I've come across is that JSTL's namespace has changed. I have to update all of my facelet templates from:

xmlns:c="http://java.sun.com/jstl/core"

to the new namespace:

xmlns:c="http://java.sun.com/jsp/jstl/core"

The difference is the "/jsp/" part. I didn't think Java EE 6 was allowed to break backward compatibility?

Once I changed the namespace in all of my templates I could run my application, but I get a new error: " var set with null or empty value"

[#|2010-08-30T10:01:30.553-0400|WARNING|oracle-glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=30;_ThreadName=http-thread-pool-8080-(1);|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.view.facelets.TagException: /D:/dev/abc/ProjectName/runtime data/themes/default/MyTemplate.xhtml @166,74 var set with null or empty value
at com.sun.faces.facelets.tag.jstl.core.SetHandler.apply(SetHandler.java:113)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91)
at com.sun.faces.facelets.tag.jstl.core.ChooseWhenHandler.apply(ChooseWhenHandler.java:77)
at com.sun.faces.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:99)
....

It appears that JSF/Facelets is now responsible for implementing JSTL and it has further broken backward compatibility by making c:set not allow empty String or null.

http://www.docjar.com/html/api/com/sun/faces/facelets/tag/jstl/core/SetH...

(lines 112 - 114)

I was hoping that maybe I could continue using the old JSTL with the old namespace by installing the necessary .jar files into GlassFish V3 using update tool, but then I get a NullPointerException when trying to install updatetool:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=13183

Using the web admin console I was able to see the list of available addons, and don't see anything that specifically mentions "JSTL".

Please help me migrate to GlassFish V3.

Thanks,
Ryan

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kchung
Offline
Joined: 2004-05-06

The uri http://java.sun.com/jstl/core was used in jstl 1.0 and the uri http://java.sun.com/jsp/jstl/core was used in jstl 1.1. All releases of jstl, (including v3) still recognize the 1.0 uri for backward compatibility. So I am puzzled to learn that it works for you in v2.1, but not in v3, especially since there have been no changes in JSTL, from v2 to v3!

The new URI was introduce to jstl 1.1 because EL (expression language) was moved from JSTL to JSP. I think it is the correct thing t NOT to use something as yesterday as jstl 1.0, which is least 5 or 7 years old!

I'll let others answer your remainding issues. :-)

rdelaplante
Offline
Joined: 2007-04-01

Thanks for the helpful information. I prefer not to use JSTL but didn't think there were equivalents of c:if, c:choose and c:set. When I look at the way I use these, I could probably use h:panelGroup with the rendered attribute to achieve the same thing.

When I first ran my application on GlassFish V3, anywhere there was a c:if or c:choose, all of the content was rendered as if the JSTL tags were not executed. That's when I discovered the new namespace.

Thanks,
Ryan

> The uri http://java.sun.com/jstl/core was used in
> jstl 1.0 and the uri
> http://java.sun.com/jsp/jstl/core was used in jstl
> 1.1. All releases of jstl, (including v3) still
> recognize the 1.0 uri for backward compatibility. So
> I am puzzled to learn that it works for you in v2.1,
> but not in v3, especially since there have been no
> changes in JSTL, from v2 to v3!
>
> The new URI was introduce to jstl 1.1 because EL
> (expression language) was moved from JSTL to JSP. I
> think it is the correct thing t NOT to use something
> as yesterday as jstl 1.0, which is least 5 or 7 years
> old!
>
> I'll let others answer your remainding issues. :-)

rdelaplante
Offline
Joined: 2007-04-01

> Once I changed the namespace in all of my templates I
> could run my application, but I get a new error:
> " var set with null or empty value"

> It appears that JSF/Facelets is now responsible for
> implementing JSTL and it has further broken backward
> compatibility by making c:set not allow empty String
> or null.

For now I changed my application to always c:set a value to get around this problem. Moving onto the next migration issue now.. :/

Thanks,
Ryan