不知道哪错了!!!大佬帮忙看看

yangz-96 2017-12-10 12:15:31
Type Exception Report

Message An exception occurred processing JSP page [/user/top.jsp] at line [31]

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

Exception
org.apache.jasper.JasperException: An exception occurred processing JSP page [/user/top.jsp] at line [31]

28: </c:if>
29: <c:if test="${sessionScope.currUser != null}">
30: <box2>
31: ${sessionScope.currUser.userName}
32: </box2>
33: </c:if>
34: </div>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:584)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


Root Cause
javax.el.PropertyNotFoundException: Property [userName] not found on type [don.Bean.User]
javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:260)
javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:212)
javax.el.BeanELResolver.property(BeanELResolver.java:347)
javax.el.BeanELResolver.getValue(BeanELResolver.java:92)
org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
org.apache.el.parser.AstValue.getValue(AstValue.java:169)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)
org.apache.jsp.user.Login_jsp._jspx_meth_c_005fif_005f1(Login_jsp.java:282)
org.apache.jsp.user.Login_jsp._jspService(Login_jsp.java:162)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/Login.css" />
<title>登录</title>
</head>
<body>
<center>
<%@include file="top.jsp"%>
<form action="../LoginServlet" method="post">
<table align="center">
<tr>
<td>
<img src="../images/logo.png" width=50px; height=60px;>
</td>
<td>
<h2>用户登录</h2>
</td>
</tr>
<tr>
<td>用户名:</td>
<td><input type="text" name="phone"></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td>
<a href="#">忘记密码?</a>
</td>
<td>
<a href="Register.jsp">还没有账号?</a>
</td>
</tr>
<tr>
<td>
<input type="submit" value="登录">
</td>
</tr>
</table>
</form>
</center>
</body>
</html>



<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.text.SimpleDateFormat,java.util.Date"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/Personal.css" />
<title>top</title>
</head>
<body>
<center>
<div class="top1">
<box1>
<a href="index.jsp" float="left">做了么菜谱网</a>
<c>
${session.currUser.userName}
</c>
</box1>
<c:if test="${sessionScope.currUser == null}">
<box2>
您尚未登录,请
<a href="Login.jsp">登陆 </a>

<a href="Register.jsp"> 注册  </a>
</box2>
</c:if>
<c:if test="${sessionScope.currUser != null}">
<box2>
${sessionScope.currUser.userName}
</box2>
</c:if>
</div>
</center>
</body>
</html>
...全文
225 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Timor_D 2017-12-18
  • 打赏
  • 举报
回复
你页面name属性名是不是错了?
xiaovhao 2017-12-10
  • 打赏
  • 举报
回复
javax.el.PropertyNotFoundException: Property [userName] not found on type [don.Bean.User]从报错信息就是没有userName这个字段,也有可能你没有提供get方法

67,514

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧