Saturday, February 16, 2013

ADF Essentials: adfBundle and JSTL core tag library

Hello all.
If you are using ADF Essentials (JDeveloper 11.1.2.3 or above) and your Web application needs to localize Strings in different languages, you've probably configured your project as described in my previous post: Oracle ADF: ViewController Strings l10n Part 1 Then, you have tested your application using the integrated Weblogic server that comes with JDeveloper and everything works OK, but when deploying the application to the Glassfish server you notice an error similar to this one in the Glassfish log:

[#|2013-02-13T16:31:44.607-0500|INFO|glassfish3.1.2|oracle.j2ee.jsp|_ThreadID=101;_ThreadName=Thread-2;|invalid taglib uri: http://java.sun.com/jsp/jstl/core, unless non taglib namespace was intended in a JSP document.|#]

Or this one:

[#|2013-02-13T16:31:44.614-0500|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=101;_ThreadName=Thread-2;|PWC1412: WebModule[null] ServletContext.log():JspServlet error: Servlet unable to dispatch to the following requested page: The following exception occurred:oracle.jsp.parse.JspParseException:
/fragments/adminReports.jsff: Line # 5, <c:set var="reportviewcontrollerBundle" value="#{adfBundle['com.rhla.rhsuite.report.view.resources.ApplicationBundle']}" xmlns:c="http://java.sun.com/jsp/jstl/core"/>
Error: Encountered deferred syntax #{ in template text. If intended as a literal, escape it or set directive deferredSyntaxAllowedAsLiteral|#]

If this is your case and you don't know why it is happening, I can tell is because when deploying to Glassfish you are missing one of the JSTL libraries, specifically you are missing library JSTL 1.2 (glassfish.jstl_1.2.0.1.jar). In order to deploy your project including this library, do the following:

Select project properties of your ViewController project:



On the opening dialog, go to the category Deployment and edit the default deployment profile:



Then, on the left panel select the category WEB-INF/lib Contributors and on the right panel select JSTL 1.2



After doing this, you can redeploy your application and the error should be gone.

see ya,



References:

OTN Discussion Forums. Oracle [online].
Available on Internet: https://forums.oracle.com/forums/thread.jspa?messageID=10725960
[accessed on February 14 2012].