Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning JavaServer Pages
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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...
Reply With Quote
  #2 (permalink)  
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 ~
Reply With Quote
  #3 (permalink)  
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!


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.