2013-12-15 145 views
5

我在Windows 7 64位上使用Eclipse Kepler和Tomcat 7。Eclipse/Tomcat忘記自定義標籤?

如果我清理項目並重新啓動服務器,一切正常。但是,如果我工作了幾分鐘...就像編輯一個JSP ... Tomcat barfs以下...

它抱怨失蹤的標記是頁面佈局的標記。除了一些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"> 
+0

你重新發布到Tomcat修改後的代碼? –

+0

它被設置爲自動生成。 Tomcat在Eclipse中被配置爲服務器。我一直認爲這意味着Eclipse會爲我照顧它。如果我將所有文件複製到單獨的Tomcat服務器(託管),它始終可以正常工作。但是Eclipse以某種方式搞砸了它。 – PrecisionPete

+0

迷失的TAG文件將在整個應用程序中使用。他們基本上是HTML設計模板... – PrecisionPete

回答

0

嘗試採取以下的,它應該工作

  1. 副本罐子在WEB-INF/lib/目錄,然後重新啓動您的Web容器

  2. 嘗試

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

例如

<%@ page language="java" import="org.apache.jsp.tag.webrating" %> 
  1. 清理項目,並重新啓動服務器