users@jersey.java.net

Jsp is not evaluated

From: Franz Wong <franzwong_at_gmail.com>
Date: Thu, 29 Apr 2010 22:45:20 +0800

Hi,

I have a @GET method returning Viewable. As I know, I can use ${it} to get
the model object. However, the jsp cannot evaluate it and it outputs the
text "${it}" instead.

I have googled for solution and I found a thread [1] talking about it.
However, there is no final solution.

I tried the small example in [1] provided by Paul Sandoz. After some time of
investigation, I found something interesting. I don't know whether it is a
known issue yet.

maven-archetype-webapp generates a web.xml with the following header.

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>

The header of web.xml I found in Paul's example is the following.

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

If I use Paul's one, my Jsp is evaluated successfully. This is not what the
behavior I expected although it works now anyway.

Regards,
Franz

[1]
http://jersey.576304.n2.nabble.com/problem-with-jsp-Viewable-not-being-evaluated-td4101170.html