为了账号安全,请及时绑定邮箱和手机立即绑定

在给Javabean属性赋值时报错500

HTTP Status 500 – Internal Server Error


Type Exception Report

Message /FirstDemo.jsp (line: [10], column: [0]) The value for the useBean class attribute [java.Person] is invalid.

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: /FirstDemo.jsp (line: [10], column: [0]) The value for the useBean class attribute [java.Person] is invalid.
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:115)
	org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1383)
	org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1186)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2389)
	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2441)
	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2447)
	org.apache.jasper.compiler.Node$Root.accept(Node.java:470)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2389)
	org.apache.jasper.compiler.Generator.generate(Generator.java:3667)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:257)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:385)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:346)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Note The full stack trace of the root cause is available in the server logs.


Apache Tomcat/9.0.8



下面是自己的代码部分:

<%--
  Created by IntelliJ IDEA.
  User: lihao
  Date: 2018/7/29
  Time: 20:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="person" class="java.Person"/>
<html>
<head>
    <title>Title</title>
</head>
<body>
<c:set target="${person}" property="password" value="1234"/>
<c:set target="${person}" property="username" value="223"/>
<c:out value="${person.username}"/>
<c:out value="${person.password}"/>
</body>
</html>
package java;
public class Person {
    private String username;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}


正在回答

2 回答

https://m.vk.com/@712772904-96781
https://m.vk.com/@712772904-96782
https://m.vk.com/@712772904-96783
https://m.vk.com/@712772904-96784
https://m.vk.com/album712772904_281898690
https://m.vk.com/album712772904_281898696
https://m.vk.com/album712772904_281898698
https://m.vk.com/album712772904_281898707
https://m.vk.com/album712772904_281898713
https://m.vk.com/album712772904_281898717
https://m.vk.com/album712772904_281898728
https://m.vk.com/album712772904_281898736
https://m.vk.com/album712772904_281898743
https://m.vk.com/album712772904_281898750
https://m.vk.com/album712772904_281898758
https://m.vk.com/album712772904_281898763
https://m.vk.com/album712772904_281898768
https://m.vk.com/album712772904_281898773
https://m.vk.com/album712772904_281898780
https://m.vk.com/album712772904_281898788
https://m.vk.com/album712772904_281898794
https://m.vk.com/album712772904_281898799
https://m.vk.com/album712772904_281898802
https://m.vk.com/album712772904_281898806
https://m.vk.com/topic-210967729_48596808
https://m.vk.com/topic-210967729_48596811
https://m.vk.com/topic-210967729_48596814
https://m.vk.com/topic-210967729_48596815
https://m.vk.com/topic-210967729_48596817
https://m.vk.com/topic-210967729_48596819
https://m.vk.com/topic-210967729_48596821
https://m.vk.com/topic-210967729_48596824
https://m.vk.com/topic-210967729_48596827
https://m.vk.com/topic-210967729_48596829
https://m.vk.com/topic-210967729_48596833
https://m.vk.com/topic-210967729_48596835
https://m.vk.com/topic-210967729_48596839
https://m.vk.com/topic-210967729_48596842
https://m.vk.com/topic-210967729_48596846
https://m.vk.com/topic-210967729_48596850
https://m.vk.com/topic-210967729_48596853
https://m.vk.com/topic-210967729_48596856
https://m.vk.com/topic-210967729_48596860
https://m.vk.com/topic-210967729_48596863
https://m.vk.com/topic-210967729_48596865
https://m.vk.com/topic-210967729_48596870
https://m.vk.com/topic-210967729_48596873
https://m.vk.com/topic-210967729_48596875
https://m.vk.com/topic-210967729_48596879
https://m.vk.com/topic-210967729_48596882
https://m.vk.com/topic-210967729_48596885
https://m.vk.com/topic-210967729_48597041
https://m.vk.com/topic-210967729_48597043
https://m.vk.com/topic-210967729_48597046
https://m.vk.com/topic-210967729_48597048
https://m.vk.com/topic-210967729_48597051
https://m.vk.com/topic-210967729_48597054
https://m.vk.com/topic-210967729_48597057
https://m.vk.com/topic-210967729_48597059
https://m.vk.com/topic-210967729_48597060
https://m.vk.com/topic-210967729_48597062
https://m.vk.com/topic-210967729_48597064
https://m.vk.com/topic-210967729_48597067
https://m.vk.com/topic-210967729_48597069
https://m.vk.com/topic-210967729_48597070
https://m.vk.com/topic-210967729_48597073
https://m.vk.com/topic-210967729_48597075
https://m.vk.com/topic-210967729_48597078
https://m.vk.com/topic-210967729_48597080
https://m.vk.com/topic-210967729_48597082
https://m.vk.com/topic-210967729_48597083
https://m.vk.com/topic-210967729_48597085
https://m.vk.com/topic-210967729_48597088
https://m.vk.com/topic-210967729_48597092
https://m.vk.com/topic-210967729_48597095
https://m.vk.com/topic-210967729_48597097
https://m.vk.com/topic-210967729_48597099
https://m.vk.com/topic-210967729_48597101
https://m.vk.com/@712774205-92179
https://m.vk.com/@712774205-92180
https://m.vk.com/@712774205-92181
https://m.vk.com/@712774205-92182
https://m.vk.com/@712774205-92183
https://m.vk.com/@712774205-92184
https://m.vk.com/@712774205-92185
https://m.vk.com/@712774205-92186
https://m.vk.com/@712774205-92187
https://m.vk.com/@712774205-92188
https://m.vk.com/@712774205-92189
https://m.vk.com/@712774205-92190
https://m.vk.com/@712774205-92191
https://m.vk.com/@712774205-92192
https://m.vk.com/@712774205-92193
https://m.vk.com/@712774205-92194
https://m.vk.com/@712774205-92195
https://m.vk.com/@712774205-92196
https://m.vk.com/@712774205-92197
https://m.vk.com/@712774205-92198
https://m.vk.com/@712774205-92199
https://m.vk.com/@712774205-92200
https://m.vk.com/@712774205-92201
https://m.vk.com/@712774205-92202
https://m.vk.com/@712774205-92203
https://m.vk.com/@712774205-92204
https://m.vk.com/@712774205-92205
https://m.vk.com/@712774205-92206
https://m.vk.com/@712774205-92207
https://m.vk.com/@712774205-92208
https://m.vk.com/@712774205-92209
https://m.vk.com/@712774205-92210
https://m.vk.com/@712774205-92211
https://m.vk.com/@712774205-92212
https://m.vk.com/@712774205-92213
https://m.vk.com/@712774205-92214
https://m.vk.com/@712774205-92215
https://m.vk.com/@712774205-92216
https://m.vk.com/@712774205-92217
https://m.vk.com/@712774205-92218
https://m.vk.com/@712774205-92219
https://m.vk.com/@712774205-92220
https://m.vk.com/@712774205-92222
https://m.vk.com/@712774205-92223
https://m.vk.com/@712774205-92225
https://m.vk.com/@712774205-92226
https://m.vk.com/@712774205-92227
https://m.vk.com/@712774205-92228
https://m.vk.com/@712774205-92229
https://m.vk.com/@712774205-92230
https://m.vk.com/@712774205-92231
https://m.vk.com/@712774205-92232
https://m.vk.com/@712774205-92233
https://m.vk.com/@712774205-92234
https://m.vk.com/@712774205-92235
https://m.vk.com/@712774205-92236
https://m.vk.com/@712774205-92237
https://m.vk.com/@712774205-92238
https://m.vk.com/@712774205-92239
https://m.vk.com/@712774205-92240
https://m.vk.com/@712774205-92241
https://m.vk.com/@712774205-92242
https://m.vk.com/@712774205-92243
https://m.vk.com/@712774205-92244
https://m.vk.com/@712774205-92245
https://m.vk.com/@712774205-92246
https://m.vk.com/@712774205-92247
https://m.vk.com/@712774205-92248
https://m.vk.com/@712774205-92249
https://m.vk.com/@712774205-92250
https://m.vk.com/@712774205-92251
https://m.vk.com/@712774205-92252
https://m.vk.com/@712774205-92253
https://m.vk.com/@712774205-92254
https://m.vk.com/@712774205-92255
https://m.vk.com/@712774205-92256
https://m.vk.com/@712774205-92257
https://m.vk.com/@712774205-92258
https://m.vk.com/@712774205-92259
https://m.vk.com/@712774205-92260
https://m.vk.com/@712774205-92261
https://m.vk.com/@712774205-92262
https://m.vk.com/@712774205-92263
https://m.vk.com/@712774205-92264
https://m.vk.com/@712774205-92265
https://m.vk.com/@712774205-92266
https://m.vk.com/@712774205-92267
https://m.vk.com/@712774205-92268
https://m.vk.com/@712774205-92269
https://m.vk.com/@712774205-92270
https://m.vk.com/@712774205-92271
https://m.vk.com/@712774205-92272
https://m.vk.com/@712774205-92273
https://m.vk.com/@712774205-92274
https://m.vk.com/@712774205-92275
https://m.vk.com/@712774205-92276
https://m.vk.com/@712774205-92277
https://m.vk.com/@712774205-92278
https://m.vk.com/@712774205-92279
https://m.vk.com/@712774205-92280
https://m.vk.com/@712774205-92317
https://m.vk.com/@712774205-92318
https://m.vk.com/@712774205-92319
https://m.vk.com/@712774205-92320
https://m.vk.com/@712774205-92321
https://m.vk.com/@712774205-92322
https://m.vk.com/@712774205-92323
https://m.vk.com/@712774205-92324
https://m.vk.com/@712774205-92325
https://m.vk.com/@712774205-92326
https://m.vk.com/@712774205-92327
https://m.vk.com/@712774205-92328
https://m.vk.com/@712774205-92329
https://m.vk.com/@712774205-92330
https://m.vk.com/@712774205-92331
https://m.vk.com/@712774205-92332
https://m.vk.com/@712774205-92333
https://m.vk.com/@712774205-92334
https://m.vk.com/@712774205-92335
https://m.vk.com/@712774205-92336
https://m.vk.com/@712774205-92337
https://m.vk.com/@712774205-92338


0 回复 有任何疑惑可以回复我~

把 javabean放到body里看看

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

在给Javabean属性赋值时报错500

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信