Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics 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 January 31st, 2007, 06:06 PM
Authorized User
 
Join Date: Feb 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to IronStar
Default Problem with EL in JSP

Hi,

I created this simple JSP to experiment with EL:

<%@ page language="java" errorPage="/view/error/Error.jsp" %>


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="testVar" value="9999"/>

<html>
   <head>
      <title>JSP EL Test</title>
   </head>
   <body>
      <c:out value="${testVar}" default="00000"/>
   </body>

</html>

I added this JSP to an existing web application, and added the jstl.jar and standard.jar files to the app's WEB-INF/lib directory. When I ran the JSP the output was:

${testVar}

I moved the JSP to the jsp-examples application that is installed with Tomcat 5.5.20 (in the jsp-examples/jsp2/el directory) and ran it from there and the output was:

9999

Can anyone explain this behavior? It seems that the jsp-examples application has some setting that I'm missing, but I can't find it.

Any help you can offer is greatly appreciated.

Thanks,
Tom
 
Old January 31st, 2007, 11:54 PM
Authorized User
 
Join Date: Feb 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to IronStar
Default

I found the problem. The following thread is an excellent resource for this issue:

http://forum.java.sun.com/thread.jsp...hreadID=628740

Basically, my applications's web.xml was using a version that ignores EL by default. Check out the link above if you're having the same problem.





Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP2 EL / JSTL ignored ronMasters BOOK: Beginning JavaServer Pages 2 November 6th, 2008 07:09 AM
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





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