5

我在 Windows 7 64 位上使用 Eclipse Kepler 和 Tomcat 7。

如果我清理项目并重新启动服务器,一切正常。但是如果我工作几分钟......就像编辑一个jsp......Tomcat会抛出以下......

它抱怨缺少的标签是页面布局的标签。除了包含一些 jspf 并且内容页面还调用其他标签之外,没有什么令人兴奋的了。但同样,没有什么令人兴奋的......

我不明白我是如何造成这种情况的,因为事情最初编译并运行良好。但随后 Tomcat 似乎忘记了标记类。

如果我清理项目,它会恢复工作一段时间......

有任何想法吗?谢谢

HTTP Status 500 - Unable to compile class for JSP:

type Exception report

message Unable to compile class for JSP:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 33 in the jsp file: /folder/page.jsp
org.apache.jsp.tag.weblayout_002dmain_tag cannot be resolved to a type
30: 
31: 
32: 
33: <tags:layout-main>
34:     <jsp:attribute name="title">page</jsp:attribute>
35:     <jsp:attribute name="section">user</jsp:attribute>
36:     <jsp:attribute name="handle">page</jsp:attribute>


An error occurred at line: 33 in the jsp file: /folder/page.jsp
org.apache.jsp.tag.weblayout_002dmain_tag cannot be resolved to a type
30: 
31: 
32: 
33: <tags:layout-main>
34:     <jsp:attribute name="title">page</jsp:attribute>
35:     <jsp:attribute name="section">user</jsp:attribute>
36:     <jsp:attribute name="handle">page</jsp:attribute>


An error occurred at line: 106 in the jsp file: /folder/page.jsp
org.apache.jsp.tag.webrating_tag cannot be resolved to a type
103:            <div class="page clearfix">
104:                <div class="title">
105:                    <h3>${page.name}</h3>
106:                    <br><tags:rating value="${3}"/>                         
107:                    <br>${page.type}
108:                </div>
109:                <div class="hours">
4

1 回答 1

0

尝试以下任何一种,它应该工作

  1. 将 jar 复制到WEB-INF/lib/目录中,然后重新启动您的 Web 容器

  2. 尝试

    <%@ page language="java" import="Pkgname.className.*" %>
    

例如

    <%@ page language="java" import="org.apache.jsp.tag.webrating" %>
  1. 清理项目并重启服务器
于 2014-04-14T11:33:30.733 回答