tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 56012] New: wrong import statement generation while using the extends attribute of the page directive
Date Wed, 15 Jan 2014 07:30:17 GMT

            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

Here is the test example, extends.jsp,

<%@ page import="dvt.jsp.jaspertest.*" %>
<%@ page extends="TestJspBase" %>

and its

package dvt.jsp.jaspertest;

import jeus.servlet.jsp.HttpJspBase;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TestJspBase extends HttpJspBase {
    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

 * 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.

In my opinion, no import statement generation would be best for the simple
class name.


    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.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message