tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick McFarlane <PMcFarl...@lendx.com>
Subject RE: Tomcat 4.0 milestone 4 and jsp:expression tag
Date Wed, 13 Dec 2000 22:02:50 GMT
Pierre,

 Thanks for taking the time to email me. I downloaded the nightly build as
of 12/10/2000, got it built and running and tried changing the request-time
attribute expressions as specified and it didn't seem to have the desired
effect. It seems that they aren't recognized/evaluated. I will take a look
at the code as an exercise to see if I can understand it well enough to make
a somewhat useful suggestion.

JSP example:

<jsp:useBean id="TestBean" class="com.sandbox.beansjsps.TestBean"
scope="session" />
<html>
<head>
<title>
TestJsp
</title>
</head>
<body>
This is the string:
<jsp:expression>TestBean.getTestString()</jsp:expression>
<br>
This is what happens when we quote it:
"<jsp:expression>TestBean.getTestString()</jsp:expression>"
<br>
And if we have it as the parameter of an input (without quotes):
<br>
<input value=%=TestBean.getTestString()% width=35 height=1/>
<br>
And when it's quoted:
<br>
<input value="%=TestBean.getTestString()%" width=35 height=1/>
<br>
</body>
</html>

Thanks again,

 patrick

-----Original Message-----
From: Pierre Delisle [mailto:pierre.delisle@sun.com]
Sent: Tuesday, December 12, 2000 10:31 PM
To: tomcat-user@jakarta.apache.org
Cc: Patrick McFarlane; Yassal Habbas
Subject: Re: Tomcat 4.0 milestone 4 and jsp:expression tag


Also, you should use the nightly build of tomcat-4.0. I don't think that
request-time
expressions were properly supported in m4.

    -- Pierre

Pierre Delisle wrote:
> 
> In XML syntax, a request-time attribute is specified via the following
> syntax:
> 
>    %= ... %
> 
> Here are some snippets of interest from the JSP1.2 PFD spec:
> 
> 5.1.8 Request-Time Attributes
> An action element that can accept a request time attribute (Section
> 2.13.1) can accept an
> argument for that attribute of the form "%= text %" (white space around
> text is not needed,
> and note the missing '<' and '>'). The text, after any applicable
> quoting as in any other
> XML document, is an expression to be evaluated as in Section 2.13.1.
> 
> ...
> 
> 5.2.8 Request-Time Attribute Expressions
> Request-time attribute expressions are of the form "<%= expression %>".
> Although this
> syntax is consistent with the syntax used elsewhere in a JSP page, it is
> not a legal XML
> syntax. The XML mapping for these expressions is into values of the form
> "%= expression'
> %", where the JSP specification quoting convention has been converted to
> the XML quoting
> convention.
> 
>     -- Pierre
> 
> Patrick McFarlane wrote:
> >
> > Hello,
> >
> >  I'm trying to use Tomcat 4.0 milestone 4 to take advantage of it's
support
> > for XML compliant JSP tags. I understand from the New Spec document that
> > this functionality is not complete (medium rare if I recall). To that
> > effect, I've noticed some strange behavior when evaluating
jsp:expression
> > tags. It seems that if the jsp:expression tag is embedded in an
attribute,
> > (i.e. <input
> > value="<jsp:expression>TestBean.getTestString()</jsp:expression>"
width=35
> > height=1/> ) then the jsp:expression tag is not recognized. I'm not sure
if
> > this is a known issue/bug or some sort of user error. I've attached some
> > samples of the behavior I'm describing. There is attached a bean called
> > TestBean, a jsp page called TestJsp.jsp which uses the non XML
convention
> > (<% %>) and works properly and a jsp page called TextXMLJsp.jsp which
uses
> > the XML compliant jsp:expression syntax and does not behave properly.
> >
> > Thanks in advance for looking at this...
> >
> >         patrick
> >
> > patrick mcfarlane
> > sr. java engineer
> > lendx
> > pmcfarlane@lendx.com

Mime
View raw message