evaluating JSP 2 expressions (EL) with tomcat 5.0

M

Markus Becker

Hello world,

i have some problems with evaluating expessions using the EL
introduced with JSP 2. i'm using tomcat 5.0 and the tomcat-example
jsps concerning EL work fine.

(e.g. http://localhost:8080/jsp-examples/jsp2/el/basic-arithmetic.jsp)

But if i place the same jsp in another web-context i did not get the
expected result because the expressions are not performed.

As a result the output shown at the browser is '${1+1}' instead of
'2'.

What kind of configuration is necessary to make the jsp-engine
generating my code?

Thanks in advance,
Markus.
 
P

Phil Hanna

i have some problems with evaluating expessions using the EL
introduced with JSP 2. i'm using tomcat 5.0 and the tomcat-example
jsps concerning EL work fine.

(e.g. http://localhost:8080/jsp-examples/jsp2/el/basic-arithmetic.jsp)

But if i place the same jsp in another web-context i did not get the
expected result because the expressions are not performed.

You need the jar files that implement JSTL and EL. Look at the
/WEB-INF/lib directory of the jsp-examples webapp; you'll find the two
jars you need there (jstl.jar and standard.jar). Copy these to the
/WEB-INF/lib directory of your application and restart it. You might
want a later copy; I don't know how recent the ones in the Tomcat 5
examples are. Check
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html for the
latest.
 
M

Markus Becker

Copy these to the
/WEB-INF/lib directory of your application and restart it.

I already tried this but without success. Both files are placed in the
WEB-INF, the result stays the same. There must be something else to
do. Got some idea?
 
R

Richard Corfield

Hello world,

i have some problems with evaluating expessions using the EL
introduced with JSP 2. i'm using tomcat 5.0 and the tomcat-example
jsps concerning EL work fine.

[...]

Your web.xml has to be a JSP2.0 web.xml. The syntax of the opening
element is changed. Tomcat identifies if you have a pre-2.0 or a 2.0
web.xml and uses this to determine whether or not it should switch on
EL. I've not had to put any EL specific jars into my projects.

One of my projects' web.xml starts thus (beware line wrapping. I don't
know if its Google Groups wrapping the long line, or just displaying
it wrapped. My web-app tag has only 4 lines, not 5. There is a space
between j2ee and web-app in the last line, not a carriage return):


<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app 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
web-app_2_4.xsd">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top