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

报错求解答

HTTP Status 500 - /WEB-INF/jsp/black/list.jsp (line: 48, column: 7) "${status.index%2!=0}" contains invalid expression(s): javax.el.ELException: Failed to parse the expression [${status.index%2!=0}]


<c:forEach items=" ${messageList}"  var="message" varStatus="status">

<tr <c:if test="${status.index%2!=0}">style='background-color:#ECF6EE;'</c:if> >

<td><input type="checkbox" /></td>

<td>${status.index +1}</td>

<td>${message.command }</td>

<td>${message.description }</td>

<td><a href="#">修改</a>&nbsp;&nbsp;&nbsp; <a href="#">删除</a>

</td>

</tr>

</c:forEach>


正在回答

1 回答

Class.forName("com.mysql.jdbc.Driver");

Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/micro_message","root","Admin123456");

//sql语句

String sql = "select ID,COMMAND,DESCRIPTION,CONTENT from message";

//创建声明

PreparedStatement statement = conn.prepareStatement(sql);

//执行查询

ResultSet rs = statement.executeQuery();

//查询结果保存到List

List<Message> messageList = new ArrayList<Message>();

while(rs.next()){

Message message = new Message();

messageList.add(message);

message.setId(rs.getString("ID"));

message.setDescription(rs.getString("DESCRIPTION"));

message.setContent(rs.getString("CONTENT"));

message.setCommand(rs.getString("COMMAND"));

}

//向页面传参

req.setAttribute("messageList", messageList);

} catch (SQLException e) {

e.printStackTrace();

} catch (ClassNotFoundException e) {

e.printStackTrace();

}

req.getRequestDispatcher("/WEB-INF/jsp/black/list.jsp").forward(req, resp);


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

举报

0/150
提交
取消

报错求解答

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