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 14:34:44 GMT

Check the tld for the equalsParameter taglib and ensure that rtexprvalue
element is turned on for the 'name' attribute. It should look something like
this if it is:

  <tag>
    <name>equalsParameter</name>
    .
    .
    .
       <attribute>
                <name>name</name>
                <required>yes</required>
                <rtexprvalue>yes</rtexprvalue>
       </attribute>
    .
    .
    .
  </tag>

The value for rtexprvalue can also be true, however, the default is
false/no.  So if you haven't included this tag in your tld, then you can't
pass scriptlets to your taglib in the name attribute.



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


Hi

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

Dosen't work :(

The <%=request.getAttribute("id")%> have a value from the record. But the
req:equalsParameter did'nt work :( Why?

Claus

-----Oprindelig meddelelse-----
Fra: Mader, Steve [mailto:steve.mader@eds.com]
Sendt: 1. oktober 2001 14:49
Til: 'taglibs-user@jakarta.apache.org'
Emne: RE: Request:equalsParameter


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