日期:2014-05-17  浏览次数:20691 次

一个JSP错误一直困扰着我
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 14 in the jsp file: /topic_add.jsp
The method topicAdds(Topic) is undefined for the type TopicDao
11: int count = 0;
12: TopicDao td = new TopicDaoImpl();
13: if (topic != null) {
14: td.topicAdds(new Topic(0,topic));
15: }
16: %>
17: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

不管我怎么改 怎么写 那一行总是错 为什么

------解决方案--------------------
你jsp的前边十几行代码都发出来看看
------解决方案--------------------
1、d.topicAdds(new Topic(0,topic));
首先看看有没有Topic这个对象,或者看看有没有带参的Topic的构造方法,看有没有引用该Topic对象
2、TopicDao td = new TopicDaoImpl();
检查TopicDaoImpl对象里面有没有实现topicAdds(Topic)方法
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html