tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: Repost: taglib and rtexprvalue problem/bug
Date Tue, 11 Sep 2001 18:46:33 GMT
Kevin,

Assuming your post doesn't have typo's, I think the JSP 1.2 spec
still requires the inner quotes to be escaped. I don't recall
that changing. Try changing:

<opf:orderDetail from="<%= request.getParameter("from") %>">

to:

<opf:orderDetail from="<%= request.getParameter(\"from\") %>">
                                                ^     ^
I have been bit by this numerous times.

Larry

> -----Original Message-----
> From: Kevin HaleBoyes [mailto:kcboyes@yahoo.com]
> Sent: Tuesday, September 11, 2001 1:55 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Repost: taglib and rtexprvalue problem/bug
> 
> 
> I posted this the other day but no one responded.
> I've since moved from Tomcat 4.0-b7 to 4.0-rc1 and the
> problem still exists so I thought I would try again...
> 
> 
> I have one jsp that <jsp:include>'s another and augments the
> request parameters using <jsp:param>.  The included jsp uses a
> taglib tag with the <rtexprvalue> attribute set to true.
> 
> The problem is I keep getting the following exception when I use
> an expression in the attribute field:
> 
>     org.apache.jasper.compiler.ParseException:
>             /WEB-INF/jsp/od.jsp(12,53) Attribute from has no value
> 
> Here is the taglib.tld excerpt:
> 
>     <!DOCTYPE taglib
>        PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
>        "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
> 
>     <tag>
>      <name>orderDetail</name>
>      <tagclass>taglib.orddet.OrderDetailsTag</tagclass>
>      <bodycontent>JSP</bodycontent>
>      <info></info>
> 
>      <attribute>
>       <name>from</name>
>       <required>true</required>
>       <rtexprvalue>true</rtexprvalue>
>      </attribute>
>     </tag>
> 
> The outer jsp file is simple:
> 
>      <html><head><title>Test</title></head>
>      <body><center><h1>Test</h1></center>
>      <jsp:include page="/WEB-INF/jsp/od.jsp">
>        <jsp:param name="from" value="p:D"/>
>      </jsp:include>
>      </body></html>
> 
> And the included jsp file isn't much more complicated:
> 
>     <%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="opf" %>
> 
>     <pre>od.jsp<br />
>     <%= request.getParameter("from") %></pre>
> 
>     <opf:orderDetail from="<%= request.getParameter("from") %>">
>       PO Number:<opf:orderAttr attribute="ponumber"/>
>     </opf:orderDetail>
> 
> If I use the included file as shown then I get the
> 'Attribute from has no value' Parse exception.  If I replace the
> <opf:orderDetail> line to a static string
> <opf:orderDetail from="p:D">
> then the file gets included just fine __and__ the
> getParameter() call
> at the top shows that the parameter is, in fact, set.
> 
> I really don't understand what I'm doing wrong and would appreciate
> any help.  This is Tomcat 4.0-rc1 on Linux RedHat 7.1.
> 
> Kevin HaleBoyes
> 
> 
> 
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
> 

Mime
View raw message