“/left.do”中的 ServletException:java.lang.ClassNotFoundException:org.apache.jsp.WEB_002dINF.tiles.leftlogged_jsp
将 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
奇怪的是,在集成 esapi 时我什至没有触及任何 jsp 页面,而且它事先就可以工作。我只修改了几个java页面,但在成功登录后我现在得到了这个。
如果有帮助的话,我可以包含更多关于这两个错误消息的信息。因为我还没有修改 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>
有人可以向我解释一下 Eclipse 到底不喜欢什么吗,因为现在我不确定我应该检查什么?
更新: 我从代码中删除了除 Welcome 和 taglib 之外的所有内容,以便 leftlogged.jsp 如下所示:
Welcome ${USERNAME}!<br />
错误消息继续存在并且没有任何更改。
关于这可能意味着错误的任何进一步的想法吗?
After integrating ESAPI into a login form I am getting a rendering issue and an error after a successful login.
The error generated in the browser states:
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
And the server's debug log states the following:
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
The weird thing is, I haven't even touched any jsp pages when integrating esapi, and it worked before hand. I've only modified a couple java pages yet I get this now after a successful login.
There is more to both error messages I can include if it will be helpful. Since I haven't modified the leftlogged.jsp, yet it is the one giving the problems I thought I'd include it as well as it may be helpful.
<%@ 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>
Could someone explain to me what exactly Eclipse is not liking because of right now I'm not sure what I should check out?
UPDATE: I removed everything except the Welcome and taglibs from the code so that the leftlogged.jsp looks as follows:
Welcome ${USERNAME}!<br />
The error message continues and didn't change any.
Any further thoughts on what that could possibly mean is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题(ClassNotFound ... WEB_002dINF ...)
我通过从
pom.xml 中删除来修复它
I had a same problem (ClassNotFound ... WEB_002dINF ...)
I fix it by deleting
from my pom.xml
或者,如果删除 javax.servlet 会破坏您的应用程序,并且您从另一个源继承它(例如,您的团队将共享资源放入的公共项目),请尝试添加
javax.servlet 的依赖项标记。
Alternatively, if removing javax.servlet breaks your app and you're inheriting it from another source (a common project that your team puts shared resources in, for example), try adding
in the dependency tag for javax.servlet.