After much trial and error, I have isolated a couple of lines in JSP that worked
with the JSP 1.0 reference implementation, but no not work with the
jswdk-1.0-ea. Can anyone tell me what the new rules are to explain why the
following no longer work.

Here is a simple TODAY servlet, in which the import attribute of the page
directive does not seem to work:
   <html>
   <head>
   <META NAME="Pragma" CONTENT="no-cache">
   <META NAME="Cache-Control" CONTENT="no-cache">
   <META NAME="Expires" CONTENT="0">
   <title>Today</title>
   </head>
   <%@ page import="java.util.*" %>
   <body >
   <H1> The current date and time is:</h1>
   <p> <%= new Date( ) %> </p>
   </body>
   </html>
To make this work I have to modify the the expression following the H1 to be <%=
 new java.util.Date>. Why?
I tried adding    language="java"  to the page directive, but that made no
difference.

Now for a real JSP in which I am using beans. The following line fails to
compile, and unfortunately the error
message scrolls off my DOS window so I cannot see it.
   <jsp:setProperty name="tripInfo" property="id"
           value="<%= ( (ClubMember) member) .getId() %>" />
The bit that fails is the expression for the value attribute. At first I thought
 the import problem noted above
might be the cause, but fully qualifying the ClubMember class does not help. The
 only way to make is JSP
 run is to change this line to the useless:
   <jsp:setProperty name="tripInfo" property="id" value="1" />
What I want to do is get the id property out of a bean called member and set it
in the bean called tripInfo. Both
member and tripInfo work in other lines in this JSP.  The JSP spec has an
example of an expression inside a
setProperty tag, but even the following does not work for me:
    <jsp:setProperty name="tripInfo" property="id" value="<%=1 %>" />
For this last version I can see the error message, and it is:
    com.sun.jsp.JSPException, unable to compile class for JSP: string index out
of range -2
Taking the quotes off around the value expression doesn't help either.

To achieve what I want I have to abandon setProperty and getProperty  tags and
revert to a scriplet:
   <% tripInfo.getId(  member.getId() ); %>
But I want a JSP that uses beans and no scriplets. Is this a bug in the JSWDK,
or am I missing something?

Paula Lumby
IBM VisualAge for Java/C++/RPG Services
tel:   448-2517        (T/L) 778-2517
Room:  2G42C      2G/KB4/1150/TOR
e-mail:                     [EMAIL PROTECTED]

External Address:
IBM Toronto Laboratory
1150 Eglinton Avenue East
Toronto, Ontario, Canada, M3C 1H7

FAX:  (416) 448-4414

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to