IT_newbies 2016-02-13 03:24 采纳率: 52.9%
浏览 1538

Javaee EL访问javabean属性出错 就两行代码也会出错我都无语了

/jsp:useBean
${b.id}
.................................................................................................下面是Bean那个类
public class Bean {
String id;
String name;
public Bean() {
id="1";
name="2";
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public void setId(String id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}

}
.................................................................................................下面是错误提示
type Exception report

message Unable to compile class for JSP:

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: 12 in the jsp file: /index.jsp
Bean cannot be resolved to a type
9:

Insert title here
10:
11:
12: /jsp:useBean
13: ${b.id}
14:

15:

An error occurred at line: 12 in the jsp file: /index.jsp
Bean cannot be resolved to a type
9:

Insert title here
10:
11:
12: /jsp:useBean
13: ${b.id}
14:

15:

An error occurred at line: 12 in the jsp file: /index.jsp
Bean cannot be resolved to a type
9:

Insert title here
10:
11:
12: /jsp:useBean
13: ${b.id}
14:

15:

Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.30 logs.


Apache Tomcat/8.0.30

  • 写回答

4条回答

  • lambda-fk 2016-02-13 05:40
    关注

    Bean cannot be resolved to a type

    你使用的时候这个bean定义了没

    或者

    评论

报告相同问题?

悬赏问题

  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集