如何解决'/left.do'中的ServletException:java.lang.ClassNotFoundException:org.apache.jsp.WEB_002dINF.tiles.leftlogged_jsp的问题?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (1)
  • 关注 (0)
  • 查看 (448)

将ESAPI集成到登录表单后,在成功登录后遇到渲染问题和错误,浏览器中生成的错误指出:

   javax.servlet.ServletException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: ServletException in '/left.do': java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.tiles.leftlogged_jsp

服务器的调试日志说明如下:

SEVERE: Servlet.service() for servlet [ActionServlet] in context with path [/FIXED] 
threw exception [javax.servlet.ServletException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: ServletException in '/left.do': java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.tiles.leftlogged_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.tiles.leftlogged_jsp

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
Welcome ${USERNAME}!<br />
<logic:messagesPresent message="false">
  <html:messages id="msg">
    <span class="error"><bean:write name="msg" /></span><br />
  </html:messages>
</logic:messagesPresent>
<logic:messagesPresent message="true">
  <html:messages id="msg" message="true">
    <strong><bean:write name="msg" /></strong><br />
  </html:messages>
</logic:messagesPresent>
Your account balance is <fmt:formatNumber pattern="\$#,##0.00" value="${BALANCE}" />
<br />
<br />
Add Balance:<br />
<html:form method="POST" action="/addbalance">
<table border="0" width="100%">
<tr>
<td class="prompt">Type:</td>
<td class="ui"><html:select property="vendor">
<html:option value="">-- SELECT</html:option>
<html:option value="VISA">VISA</html:option>
<html:option value="MASTERCARD">MASTERCARD</html:option>
</html:select>
</td>
</tr>
<tr>
  <td class="prompt">Number:</td>
  <td class="ui"><html:password property="cc" /></td>
</tr>
<tr>
  <td class="prompt">Amount:</td>
  <td class="ui"><html:text property="amount" /></td>
</tr>
<tr>
  <td colspan="2" class="ui" style="text-align: center"><input type="submit" value="Add" /></td>
</tr>
</table>
</html:form>
<br />
<br />
<a href="<c:url value="/friends.do" />">Friends</a><br />
<a href="<c:url value="/profile.do" />">Profile</a><br />
<a href="<c:url value="/index.jsp" />">CD's</a>
<br />
<br />
<a href="<c:url value="/logout.do" />">Log Out</a>
提问于
用户回答回答于

这样试试:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.0</version>
</dependency>

扫码关注云+社区

领取腾讯云代金券