我已經下載了截至2011年1月16日的最新版本的tomcat 7,即7.0.23。我發現我的jakarta標記庫組件都不在jsps中工作。每個jsp中的失敗點都是一樣的和一致的。這是Tomcat 7.0.23不能與標籤庫一起工作
org.apache.taglibs.input.Select _jspx_th_input_005fselect_005f0 = (org.apache.taglibs.input.Select)_jsp_instancemanager.newInstance("org.apache.taglibs.input.Select", this.getClass().getClassLoader());
我也寫了一個自定義的標籤,看看它是否工作,我有同樣的問題的那個JSP了。
com.ah.util.customtags.SelectTag _jspx_th_hirezon_005fform_005fselect_005f0 = (com.ah.util.customtags.SelectTag)_jsp_instancemanager.newInstance("com.ah.util.customtags.SelectTag", this.getClass().getClassLoader());
的JSP代碼
<%@ page extends="com.ah.servlets.BaseJSPServlet"%>
<%@ taglib uri="/WEB-INF/hirezon_form.tld" prefix="hirezon_form" %>
<html>
<body>Test tags
<%
System.setProperty("org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS", "true");
%>
<hirezon_form:select count="100"/>
</body>
</html>
爲CustomTagSupport類的代碼
package com.ah.util.customtags;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
public class SelectTag extends TagSupport {
String count;
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public int doStartTag() throws JspException {
// This means the JSP must evaluate the contents of any CHild tags
// in this tag;
return EVAL_BODY_INCLUDE;
}
// This method is called when the JSP encounters the end of te tag
// implemented by this class
public int doEndTag() throws JspException {
String sum = "200000";
try {
pageContext.getOut().write("The Sum of first " + count + " numbers is " + sum);
} catch (IOException e) {
throw new JspException("Fatal Error: HelloTag could'nt write to the JSP out");
}
// This return type tells the JSP page to continue processing
// the rest of the page
return EVAL_PAGE;
}
}
是否有Tomcat的7.0.23一個已知的bug?我做了大量的研究,並嘗試將USE_INSTANCE_MANAGER_FOR_TAGS屬性設置爲true,但我仍然遇到同樣的錯誤。任何建議將不勝感激,謝謝