You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/01/15 08:30:17 UTC
[Bug 56012] New: wrong import statement generation while using the
extends attribute of the page directive
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: dev@tomcat.apache.org
Reporter: bluewolf.chung@gmail.com
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 56012] wrong import statement generation while using the
extends attribute of the page directive
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56012
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Thanks for the report and especially for the references. Having that
information to hand makes the fix a lot quicker as we don't have to go digging
to find it ourselves
The fix has been applied to 8.0.x for 8.0.0 onwards and to 7.0.x for 7.0.51
onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 56012] wrong import statement generation while using the
extends attribute of the page directive
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56012
Eugene Chung (TmaxSoft) <bl...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |howeverking@gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 56012] wrong import statement generation while using the
extends attribute of the page directive
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56012
--- Comment #1 from Eugene Chung (TmaxSoft) <bl...@gmail.com> ---
It is a compile time error to import a type from the unnamed package.
(from http://docs.oracle.com/javase/specs/jls/se5.0/html/packages.html#70209)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org