52: </tr>
53: <tr>
54: <c:forEach var="obj" items="${requestScope.all} " varStatus="fl" >
55: <td>${obj.foodName}  ${obj.foodprice}</td>
56: <c:if test="${fl.count%4 eq '0'}"></tr>
57: </c:if>
错误日志:org.apache.jasper.JasperException: 在 [55] 行处理 [/store.jsp] 时发生异常
错误原因? items="${requestScope.all}? "后添加了空格 提示500
=========================================================================
<form action="${pageContext.request.contextPath}/login" method="post">
<input type="button" value="退出" onclick="location.href='${pageContext.request.contextPath}/logout'"/>
<input type="button" value="个人信息" onclick="location.href='user.jsp'"/>
</form>
错误日志:404
解决方法 在jsp文件body下构建javascript脚本
=========================================================================
writer.print("<script type='text/javascript'> alert('请先登录'); location.href='login.jsp'</script>");
PrintWriter writer = resp.getWriter();
writer.print("<script type='text/javascript'> alert('请先登录'); location.href='login.jsp'</script>");
writer.print("<script type='text/javascript'>");
writer.print("alert('请先登录');");
writer.print("location.href='login.jsp';");
writer.print("</script>");
错误日志:第一条无弹窗内容
问题原因 writer方法中需要写分号
|