本人是刚学的java,出个这问题。求帮忙

J2EE 码拜 8年前 (2016-03-20) 1243次浏览
Struts Problem Report
Struts has detected an unhandled exception:
Messages:
1、Encountered ” “?” “? “” at line 1, column 18. Was expecting one of: “}” … “.” … “[” … “>” … “gt” … “<” … “lt” … “>=” … “ge” … “<=” … “le” … “==” … “eq” … “!=” … “ne” … “&&” … “and” … “||” … “or” … “*” … “+” … “-” … “/” … “div” … “%” … “mod” …
2、Failed to parse the expression [${email.isRead==1?”已读”:”未读” }]
3、An exception occurred processing JSP page /emailAll.jsp at line 108 105: <tr <c:if test=”${i.count%2==0 }”>style=”background-color: gray”</c:if>> 106: <td align=”right” width=”30%”>${email.title }</td> 107: <td align=”right” width=”30%”>${email.context }</td> 108: <td align=”right” width=”30%”>${email.isRead==1?”宸茶”锛鏈” }</td> 109: <td align=”right” width=”30%”>${email.senderDate }</td> 110: <td align=”right” width=”30%”></td> 111: </tr> Stacktrace:
File: org/apache/el/parser/ELParser.java
Line number: 2,217
下面是jsp页面:
<%@ page language=”java” contentType=”text/html; charset=UTF-8″
pageEncoding=”UTF-8″%>
<%@ taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c”%>
<%@page import=”com.nyd.domain.User”%>

<!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″>
<title>Insert title here</title>
<link href=”css/style.css” rel=”stylesheet” type=”text/css” />
<script>
function setit() {
document.forms[0].submit();
}
</script>
</head>
<body>
<%
User loginUser = (User) session.getAttribute(“loginUser”);
%>
<div class=”top”>
<div class=”global-width”>
<img src=”Images/logo.gif” class=”logo” />
</div>
</div>
<div class=”status”>
<div class=”global-width”>
${loginUser.getName() } 你好!<a href=”#” onclick=”location.href=”loginOut.action””>注销</a>
</div>
</div>
<form id=”myForm” name=”myForm” action=”updateUser.jsp” >
<input type=”hidden” name=”u.id” value=”${loginUser.id }” />
<input type=”hidden” name=”u.gender” value=”${loginUser.gender }” id=”u_gender” />
<input type=”hidden” name=”u.role” value=”${loginUser.role }” id=”u_role” />
<div class=”main”>
<div class=”global-width”>
<div class=”nav” id=”nav”>
<div class=”t”></div>
<dl>
<dt
onclick=”this.parentNode.className=this.parentNode.className==”open”?””:”open”;”>信息管理
</dt>
<dd>
<a href=”user!findById.action?user.id=${loginUser.id }” target=”_self”>个人信息</a>
</dd>
</dl>
<dl>
<dt
onclick=”this.parentNode.className=this.parentNode.className==”open”?””:”open”;”>
邮件管理</dt>
<dd>
<a href=”email.html” target=”_self”>写邮件</a>
</dd>
<dd>
<a href=”mailReceive!receive.action” target=”_self”>收邮件</a>
</dd>
<dd>
<a href=”mailGarage!garage.action” target=”_self”>垃圾邮件</a>
</dd>
</dl>
<dl>
<dt
onclick=”this.parentNode.className=this.parentNode.className==”open”?””:”open”;”>
考勤管理</dt>
<dd>
<a href=”leave.action” target=”_self”>休假</a>
</dd>
</dl>
<dl>
<dt
onclick=”this.parentNode.className=this.parentNode.className==”open”?””:”open”;”>
权限管理</dt>
<dd>
<a href=”userInfo!singleAccountData.action” target=”_self”>个人账户</a>
</dd>
</dl>
</div>
<div class=”action”>
<div class=”t”>邮件信息列表</div>
<div class=”pages”>
<table width=”90%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<th width=”10%”>邮件标题</th>
<th width=”20%”>内容</th>
<th width=”10%”>能否已读</th>
<th width=”10%”>时间</th>
<th width=”10%”>操作</th>
</tr>
<c:forEach items=”${page.list }” var=”email” varStatus=”i”>
<tr <c:if test=”${i.count%2==0 }”>style=”background-color: gray”</c:if>>
<td align=”right” width=”30%”>${email.title }</td>
<td align=”right” width=”30%”>${email.context }</td>
<td align=”right” width=”30%”>${email.isRead==1?”已读”:”未读” }</td>
<td align=”right” width=”30%”>${email.senderDate }</td>
<td align=”right” width=”30%”></td>
</tr>
</c:forEach>
</table>
</div>
</div>
</div>
</div>
</form>
</body>
</html>

解决方案

10

<tr <c:if test=”${i.count%2==0 }”>style=”background-color: gray”</c:if>>
这么写是什么鬼,还有就是你那个表达式不认
${email.isRead==1?”已读”:”未读” }

10

看了下你的异常信息,建议你重新部署项目再重新启动服务器试试,看看能不能解决

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明本人是刚学的java,出个这问题。求帮忙
喜欢 (0)
[1034331897@qq.com]
分享 (0)