为什么会有这种错误?javax.servlet.ServletException: Attempt to coerce a value of type "[Ljava.util.SortedMap;" to type "java.lang.Long"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
代码如下:username,password 为表单传递过来的数据。
<%@ page language="java" buffer="32kb" %>
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<%@include file="/datasource.inc"%>
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>登陆验证</title>
</head>
<body bgcolor="#FFFFFF">
<sql:query var="query1" dataSource="${base}">
select * from Users where name=? and password=?
<sql:param value="${param.username}"/>
<sql:param value="${param.password}"/>
</sql:query>
<c:url var="ul" value="index.jsp"></c:url>
<c:if test="${query1.rows>0}" >
<c:redirect url="${ul}"></c:redirect>
</c:if>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
数据库表名为:Users
字段为:name varchar 30
password varchar 20
password
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
代码如下:username,password 为表单传递过来的数据。
<%@ page language="java" buffer="32kb" %>
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<%@include file="/datasource.inc"%>
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>登陆验证</title>
</head>
<body bgcolor="#FFFFFF">
<sql:query var="query1" dataSource="${base}">
select * from Users where name=? and password=?
<sql:param value="${param.username}"/>
<sql:param value="${param.password}"/>
</sql:query>
<c:url var="ul" value="index.jsp"></c:url>
<c:if test="${query1.rows>0}" >
<c:redirect url="${ul}"></c:redirect>
</c:if>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
数据库表名为:Users
字段为:name varchar 30
password varchar 20
password
解决方案 »
- swing开发中多JPanel面板添加背景图片问题
- action中生成applet,关闭applet后,tomcat也自动down掉了
- JSP入门问题
- 如何把数据库中的某几个表生成excel文件急用在线等!!!!!!!!!
- jsp表单提交到数据库的数据(中文字符)读取后就变成了乱码。
- 数据采集超难问题,看看谁能解!...
- 文件上传时,进度条是怎么做的啊?(包括:总文件大小、已上传文件大小--)
- 我装了个Resin2.1+jdk1.41运行JSP过一段时间后经常会造成cpu100%?
- 局域网内无线链接问题
- jsp的sql问题,帮忙看看(jsp人少),谢谢!
- 配置SERVLET,急需老师近来帮忙!
- JDBC无法连接SQL SERVER2000问题
嘎嘎~!
<%@ page language="java" buffer="32kb" %>
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<%@include file="/datasource.inc"%>
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>登陆验证</title>
</head>
<body bgcolor="#FFFFFF">
<sql:query var="query1" dataSource="${base}">
select * from Users where name=? and password=?
<sql:param value="${param.username}"/>
<sql:param value="${param.password}"/>
</sql:query>
<c:url var="ul" value="index.jsp"></c:url>
<c:if test="${<%@ page language="java" buffer="32kb" %>
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<%@include file="/datasource.inc"%>
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>登陆验证</title>
</head>
<body bgcolor="#FFFFFF">
<sql:query var="query1" dataSource="${base}">
select * from Users where name=? and password=?
<sql:param value="${param.username}"/>
<sql:param value="${param.password}"/>
</sql:query>
<c:url var="ul" value="index.jsp"></c:url>
<c:if test="${query1.rowCount>0}" >
<c:redirect url="${ul}"></c:redirect>
</c:if>
</body>
</html>
>0}" >
<c:redirect url="${ul}"></c:redirect>
</c:if>
</body>
</html>rowCount这样才对呵呵~!