【问题标题】:Check data entered against a database对照数据库检查输入的数据
【发布时间】:2014-02-27 00:18:52
【问题描述】:

我正在尝试从网页获取输入并查询数据库,如果输入与数据库匹配,则转到下一页并“登录”

<sql:query var="result">
SELECT * from Customer where customer_number=1;
</sql:query>
<form>
Enter your surname<input type="text" name="surname"/><br><br>
Enter your passphrase <input type="text" name="passphrase"/>
<input type="submit" name="B1" value="Submit" />
</form>
<c:if surname="${result.rows[0]['surname']}">
<p>My salary is: <c:out value="${salary}"/><p>
</c:if>

目前它获取数据库的一行,但我需要它在数据库中搜索一个参数,然后如果存在,则检查该元组的另一个参数。目前我收到一个错误:

HTTP Status 500 - /withdraw_basic.jsp (line: 23, column: 0) According to the TLD or the tag file, attribute test is mandatory for tag if

我不知道为什么会失败。 我是新手,所以要温柔。谢谢

【问题讨论】:

    标签: html mysql jstl


    【解决方案1】:

    我相信您的文档顶部有这个:

    <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
    

    你也忘了正确关闭你的p标签:

    <p>My salary is: <c:out value="${salary}"/><p>
    <!-- Missed a slash here                   ^ -->
    

    我想对此发表评论,但没有 50 次代表!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-23
      • 1970-01-01
      • 2016-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多