tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mader, Steve" <steve.ma...@eds.com>
Subject RE: Request:equalsParameter
Date Mon, 01 Oct 2001 12:48:49 GMT
I've had the same issue with a different taglib.  You can first place the
value into an attribute using the 'to' parameter of the <sql:getColumn> tag.
Then use an <%= %> scriptlet as the parameter to your <req:equalsParameter>
taglib.

Example:

FROM:
<req:equalsParameter name="id" match="<sql:getColumn colName="id"/>"
.
.
.

TO:
<sql:getColumn colName="id" 
               to="id" 
               scope="request"/>    <%-- Default is the page %-->

<req:equalsParameter name="id" 
                     match="<%=request.getAttribute(\"id\")%>"
.
.
.

Yes I know this seems messy but I think it should work as long as the
rtexprvalue parameter for equalsParameter is turned on.


-----Original Message-----
From: Claus Jul Larsen [mailto:cjlarsen@enovasion.dk]
Sent: Monday, October 01, 2001 7:18 AM
To: 'taglibs-user@jakarta.apache.org'
Subject: SV: Request:equalsParameter


Yes, It seem to be the correct reply but the attribute must be the value
from a sql record:

<sql:statement id="stmt2" conn="conn1">
<sql:query>
select id,sygdom from tblData5 where status=1
</sql:query>
<sql:resultSet id="rset3">
<TR><TD VALIGN=TOP><IMG SRC="/images/rod_bullet.gif"></TD>
<TD VALIGN=TOP class=content>
<req:equalsParameter name="id" match="<sql:getColumn colName="id"/>"
value="false">
<A HREF="index.jsp?id=<sql:getColumn colName="id"/>"><sql:getColumn
colName="sygdom"/></A>
</req:equalsParameter>
<req:equalsParameter name="id" match="<sql:getColumn colName="id"/>"
value="true">
<B><sql:getColumn colName="sygdom"/></B>
</req:equalsParameter>
</TD></TR>
</sql:resultSet>
</sql:statement>

I want to check the value of req.equalsparameter with the value of the
db-row's id - how? I cannot use tags into an attribute huh?

Claus from Denmark

-----Oprindelig meddelelse-----
Fra: Stephen Latter [mailto:stephen@netxtra.net]
Sendt: 1. oktober 2001 13:16
Til: taglibs-user@jakarta.apache.org
Emne: re: Request:equalsParameter


> <req:equalsParameter name="id" match="<%= id %>" value="false">
> ....snip!...
> Doesn't work! 

Have you set the attribute for that tag-lib to allow run time expression
values so that the <%= id %> bit actually get converted?

In the TLD for the tag-lib you need to specify that a particular tag
attribute can accept expressions as well as straight values.

See http://java.sun.com/products/jsp/tutorial/TagLibraries11.html for more
info. Look for <rtexprvalue>true|false|yes|no</rtexprvalue> 

Hope this helps and I haven't missed the point!

Stephen.

Mime
View raw message