Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaServer Pages
This is the forum to discuss the Wrox book Beginning JavaServer Pages by Vivek Chopra, Jon Eaves, Rupert Jones, Sing Li, John T. Bell; ISBN: 9780764574856
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaServer Pages section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2006, 06:15 PM
Registered User
 
Join Date: Feb 2006
Location: Redcliffe, Queensland, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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...
 
Old May 14th, 2006, 03:17 PM
Registered User
 
Join Date: Jul 2003
Location: Bracknell, Berkshire, United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kizmit
Default

Hi Ron,

I'm having the same problem as you, did you ever manage to resolve this?

Thanks
Carla

~ Carla ~
 
Old November 6th, 2008, 07:09 AM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi guys,

I am quite sure you have resolved this issue at this time, I just answer in order to help other people who will look at this thread in the future.

I have had the same problem switching the same app from Tomcat6.0 to Tomcat5.0, and I solved it by correcting the attributes of the "web-app" tag in my web.xml file: they where referring to the wrong version (2.5), since Tomcat5.5 uses 2.4.

This is the correct tag for web.xml working with Tomcat5.5:

<web-app id="WebApp_ID"
    version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
        http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      ....
</web-app>

Hope this hint may help somebody outthere.
Good bye everybody!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with EL in JSP IronStar JSP Basics 1 January 31st, 2007 11:54 PM
EL Syntax error savoym JSP Basics 0 November 2nd, 2006 04:48 PM
About EL motofree Java Basics 0 March 1st, 2006 05:07 AM
JSP2 EL/JSTL being ignored ronMasters JSP Basics 0 February 23rd, 2006 07:36 AM
BEGINNING JSP2.0 sourav_banerjee JSP Basics 1 September 14th, 2004 01:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.