https://issues.apache.org/bugzilla/show_bug.cgi?id=57508
Bug ID: 57508
Summary: tomcat-8.0.17 Unable to compile class for JSP on JDK8
Product: Tomcat 8
Version: 8.0.17
Hardware: PC
OS: Linux
Status: NEW
Severity: major
Priority: P2
Component: Jasper
Assignee: [email protected]
Reporter: [email protected]
1.I use jdk8, define a interface named TestInterface:
package test;
public interface TestInterface {
public static String test() {
return "*************";
}
}
2.use this interface in my jsp named test.jsp:
<%@ page import="test.TestInterface" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title></title>
</head>
<body>
<%
TestInterface.test();
%>
</body>
</html>
3.access the test.jsp, occur errors below:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 9 in the jsp file: /b.jsp
This static method of interface TestInterface can only be accessed as
TestInterface.test
6: </head>
7: <body>
8: <%
9: TestInterface.test();
10: %>
11: </body>
12: </html>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:570)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]