У меня странная ошибка с пользовательским тегом JSP и Tomcat 8. С Tomcat 7 он работает.Пользовательские теги JSP и Tomcat 8
ДВА-файл:
<?xml version="1.0" encoding="UTF-8" ?>
<taglib version="2.0"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd">
<tlib-version>1.0</tlib-version>
<short-name>Example TLD</short-name>
<uri>http://www.hello.com/tags/hello</uri>
<tag>
<name>Hello</name>
<tag-class>myapp.tag.HelloTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
Handler Класс:
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
public class HelloTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
out.println("Hello Custom Tag!");
}
}
JSP (только строка 6):
...
<%@ taglib prefix="ex" uri="/WEB-INF/lib/custom.tld"%>
...
И ошибка:
Caused by: org.apache.jasper.JasperException: /WEB-INF/jsp/myapp.jsp (line: 6, column: 1) null
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:275)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:91)
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:325)
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:358)
at org.apache.jasper.compiler.Parser.parseXMLDirective(Parser.java:527)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1432)
at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:570)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
at org.apache.tiles.request.servlet.ServletRequest.doInclude(ServletRequest.java:243)
опубликовать JSP слишком – Mecon