tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Delagrange, Morgan" <mdela...@us.britannica.com>
Subject RE: validation problem in JSP
Date Thu, 22 Mar 2001 16:52:22 GMT
Hmm, the current functionality does not easily support evaluating that
number.  There are probably a couple of ways you could attack it:

  1) The Page taglib has a setAttribute tag you could use 
     to capture the value.  Then you could use the 
     equalsAttribute tag to evaluate the result.
     Warning: not a lot of active development is going on
     with regard to Page, Request, Application, Session,
     and Response tag libraries.  It's quite likely that
     they will go into maintenance mode soon.

  2) The tag could be altered with a "to" attribute similar
     to the getColumn tags, so that we could write an
     Integer attribute to the pageContext.

- Morgan


> -----Original Message-----
> From: "Weßling, Achim" [mailto:Achim.Wessling@gt-net.de]
> Sent: Thursday, March 22, 2001 9:54 AM
> To: taglibs-user@jakarta.apache.org
> Subject: validation problem in JSP
> 
> 
> Hallo,
> 
> I did the following code. My problem is marked with '*'. How 
> can I validate
> the value of <infokomGT:rowCount/> (jdbc:rowCount) with '1' so that my
> condition-tag gets the body-value 'true' or 'false'?
> 
> <%@page contentType="text/html"%>
> <%@ taglib uri="/infokomGT" prefix="infokomGT" %>
> <html>
> <head><title>User Validation</title></head>
> <body>
> <h1>Validation</h1>
> <br>Diese Werte wurden eingegeben:
> <br>
> Benutzername: <infokomGT:parameter name="user" />
> <br>
> Passwort: <infokomGT:parameter name="pw" />
> <%-- Open Database Connection --%>
> <infokomGT:connection id="con1">
>     <infokomGT:url>jdbc:odbc:user</infokomGT:url>
>     <infokomGT:driver>sun.jdbc.odbc.JdbcOdbcDriver</infokomGT:driver>
> </infokomGT:connection>
> <%-- Open Database --%>
> <infokomGT:statement id="stmt1" conn="con1">
>     <infokomGT:query>
>         SELECT FirstName, LastName, Anrede, Typ
>         FROM User
>         WHERE UserName LIKE '<infokomGT:parameter name="user" />'
>         AND Kennwort LIKE '<infokomGT:parameter name="pw" />'
>     </infokomGT:query>
>     
>     <%-- loop through the rows of query --%>
>     <infokomGT:resultSet id="rs1">
>     <infokomGT:wasNotEmpty>
>         <infokomGT:if>
> **************************************************************
> **************
> *********************************
>             <infokomGT:condition><%= <infokomGT:rowCount/> == 1
> %></infokomGT:condition>
> **************************************************************
> **************
> *********************************
>             <infokomGT:then>
>                 <br>Allright, you did it!
>             </infokomGT:then>
>         </infokomGT:if>
>     </infokomGT:wasNotEmpty>
>     </infokomGT:resultSet>
>     <infokomGT:wasEmpty>
>         <br>Sorry, but you did something wrong!
>     </infokomGT:wasEmpty>
> </infokomGT:statement>
> 
> <%-- close Database Connection --%>
> <infokomGT:closeConnection conn="con1"/>
> </body>
> </html>
> 
> Mit freundlichem Gruß
> 
> Achim Weßling
> 
> **************************************************************
> ************
> INFOKOM Gütersloh
> Fachbereich Technische Anwendungen / Zentrale Anwendungen
> Tel.: 05241/85-2926
> Achim.Wessling@gt-net.de
> http://www.infokom-gt.de/produkte/gis/index.htm
> 
> 
>                   _\|/_
>                   (o o)
>        ---oOO-{_}-OOo---
> 
> 

Mime
View raw message