tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 61604] New: IllegalStateException in SmapStratum on empty JSP
Date Tue, 10 Oct 2017 14:34:37 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=61604

            Bug ID: 61604
           Summary: IllegalStateException in SmapStratum on empty JSP
           Product: Tomcat 9
           Version: 9.0.1
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: apache@stefan-sielaff.de
  Target Milestone: -----

We use a JSP that is included at several points to inject data into pages. At
the moment the whole content is commented out.

Tomcat 8.5 (production environment) ignores that page, respectively generates
no output as expected. Tomcat 9.0.1 (development environment) throws an
IllegalstateException. This is caused by a change in SmapStratum, which
previously returned null on getString() if lineData was null, now it throws an
unhandled exception.

Reproduction:

Create an "empty" JSP or one containing only JSP comments and using
trimDirectiveWhitespaces="true":

<%@ page pageEncoding="UTF-8" contentType="text/html; charset=utf-8"
language="java" import="java.util.Vector" errorPage=""
trimDirectiveWhitespaces="true" %>
<%-- This is a comment --%>

Result:

java.lang.IllegalStateException
        at
org.apache.jasper.compiler.SmapStratum.getSmapStringInternal(SmapStratum.java:318)
        at
org.apache.jasper.compiler.SmapStratum.getSmapString(SmapStratum.java:304)
        at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:145)
        at
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:473)
[...]

Expected result:

an empty page

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


Mime
View raw message