tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weßling, Achim" <Achim.Wessl...@gt-net.de>
Subject validation problem in JSP
Date Thu, 22 Mar 2001 15:53:40 GMT
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