已经找到问题了 自己写错了 抱歉
要想有数据显示,记得首先数据库里面要有数据,不然一直都不会得到结果的,血泪的教训?
Unexpected exception encountered during query.
现在报这个错了,已经加上?useUnicode=true&characterEncoding=UTF-8
package bean;
/**
* 与消息表对应的消息队列
*
*/
public class Message {
private String id; // 主键
private String command; // 指令
private String description; // 描述
private String content; // 操作
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCommand() {
return command;
}
public void setCommand(String command) {
this.command = command;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public String toString() {
return "Message [id=" + id + ", command=" + command + ", description=" + description + ", content=" + content
+ "]";
}
}
mysql-jdbc连接jar包加了没有,或者mysql的服务有没有开。
response没有设置属性的方法
500错误是服务器端代码问题。错误提示信息已经给出具体位置了,在46行53列
忘记在花括号前加$
同问题,求解答
and 符号错误
messagelist 另一个是messageList 2个不一致
El表达式无法解析引起的,在web.xml里加入
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
import的message是小写的,你用的却是Message
已经自己解决了,是页面跳转放到了前面,导致servlet链接数据库得到的值没有成功的传进来
https://www.imooc.com/learn/924
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
talk is cheap,show me the code
检查一下 DriverManager.getConnection中三个参数的书写有没有问题
http://search.maven.org/ 上面直接找
把c标签引进去。
页面头部需要引入标签库的,jar包也要的
500是服务器内部错误,很可能是路径不对
我也遇到这个问题了,谢谢你啊,原来是取与的对象不是数字
或者你把
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>
放到list.jsp最上面
后者方法更好
看看数据库连接的时候有没有编码问题,在连接数据库的URL后加上
"?useUnicode=true&characterEncoding=UTF-8"这段字符串试试
需要的,聊天框的数据是后台的索引条件
怎么解决的,我也遇到了同样的问题?
请问你怎么解决的啊
看一下控制台报什么错