JSP2 EL / JSTL ignored
After reading 'Beginning Java Server Pages'
I recently upgraded from j2sdk 1.4 to j2se 1.5.0_06
and Tomcat from 4.0 to 5.5.15
I am still using j2sdkee 1.3
I have built a system to the MVC architecture and it has been running for 16 months. Now want to write all new JSP using EL/JSTL, and stop using scripting elements.
As a test I wrote the following jsp2Test.jsp and it appears the core tags are ignored. Then I added ...
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-enabled>true</el-enabled>
<scripting-enabled>true</scripting-enabled>
</jsp-property-group>
</jsp-config>
... to my deployment descriptor, which resulted in no change.
In this jsp2Test.jsp file only the last two lines(+) of template data are output as follows without any EL translation, with or without a request param:
buyer = ${buyer}
param.buyer is ... [${param.buyer}]
I imagine JSP is bundled with j2ee and not j2se.
Do I need to upgrade my j2ee ????
or am I missing something else.
Would appreciate some help here.
Ron...
<!--
File: jsp2Test.jsp
Author: Ron Masters
Date: 22-Feb-2006
Description: test JSP 2, EL & core taglib
under Tomcat 5.5 and J2SE 1.5.0_06
-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title></title></head>
<body>
<c:if test="${empty param.buyer}">
test.jsp - param.buyer is empty
<br> setting pageScope param buyer to "Ron"
<c:set var="buyer" value="Ron" />
</c:if>
<c:if test="${empty buyer}">
test.jsp - previous set pageScope param buyer is empty ... setting to "Alan"
<c:set var="buyer" value="Alan" />
</c:if>
buyer = ${buyer}
<br>param.buyer is ... [${param.buyer}]
</body>
</html>
**** update
I just added the following to my jsp2Test.jsp to interrogate the versions...
Servlet Engine:
<%= session.getServletContext().getMajorVersion() %>.<%= session.getServletContext().getMinorVersion() %><br>
JSP Engine:
<%= JspFactory.getDefaultFactory().getEngineInfo().get SpecificationVersion()%><br>
Application Server:
<%= application.getServerInfo()%>
... and they display:
Servlet Engine: 2.4
JSP Engine: 2.0
Application Server: Apache Tomcat/5.5.15
which all seems fine to me.
Anyone got any clues as to why JSTL and EL are not working ????
Ron...
|