https://issues.apache.org/bugzilla/show_bug.cgi?id=56012
Bug ID: 56012
Summary: wrong import statement generation while using the
extends attribute of the page directive
Product: Tomcat 7
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
Assignee: [email protected]
Reporter: [email protected]
Here is the test example, extends.jsp,
<%@ page import="dvt.jsp.jaspertest.*" %>
<%@ page extends="TestJspBase" %>
<%
out.println("TEST");
%>
and its TestJspBase.java.
package dvt.jsp.jaspertest;
import jeus.servlet.jsp.HttpJspBase;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class TestJspBase extends HttpJspBase {
@Override
public void _jspService(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
/* do nothing here */
}
}
I know that the fully qualified class name must be used while using the extends
attribute of the page directive. But the java generator of jasper has also a
problem.
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.50
* Generated at: 2014-01-15 04:56:28 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import dvt.jsp.jaspertest.*;
import TestJspBase;
public final class extends_jsp extends TestJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
The problem is 'import TestJspBase;'.
The java language spec. does not allow the class name of default package.
http://docs.oracle.com/javase/specs/jls/se5.0/html/packages.html#70209
In my opinion, no import statement generation would be best for the simple
class name.
org.apache.jasper.compiler.PageInfo
public void setExtends(String value, Node.PageDirective n) {
xtends = value;
}
FYI, there was a time that such import statement was possible to use until it
was fixed at JDK 1.4.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4361575
--
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]