tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John5342 <john5...@googlemail.com>
Subject Unified EL question
Date Wed, 01 Oct 2008 18:51:59 GMT
Hi all.

Probably not the right place to ask this but not sure there where else so
here it is. Now that all my clients have upgraded to tomcat 6.0.18 (from
various rather old versions) i am starting to write any new webapps using
jsp 2.1 including Unified EL but i am even already running into a stupid
problem and can only assume i am doing something wrong or otherwise nobody
would be using tomcat in the first place. Below is a small snippet of code
to illustrate:

A javabean:

package a.pkg;
class ABean {
  public String getString() {
    return "Hello world!";
  }
}

A jsp page:

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<jsp:useBean id="thbean" class="a.pkg.ABean" scope="session">
  <jsp:setProperty name="thebean" property="*"/>
</jsp:useBean>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>A title.</title>
    </head>
    <body>
<p>The string is: ${sessionScope.thebean.string}</p>
    </body>
</html>

All the tutorials and samples and such i can find on the net suggest the
output from this should be:

The string is: Hello world!

but i get:

The string is: ${sessionScope.thebean.string}

I just cant find anything on the net to suggest why this would happen but
plenty to say it should work. Has anybody got any ideas where i am going
wrong?
Am doing this in linux using tomcat 6.0.18 and openjdk 1.6.0.

Thanks in advance,
John

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message