Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 426757 - NPE possibly in JSP when mixing EL 2.1 and 3.0
Summary: NPE possibly in JSP when mixing EL 2.1 and 3.0
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: jsp (show other bugs)
Version: 9.1.1   Edit
Hardware: All All
: P3 normal with 3 votes (vote)
Target Milestone: 9.1.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 428749 434427 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-27 18:40 EST by Joakim Erdfelt CLA
Modified: 2014-05-08 12:06 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Erdfelt CLA 2014-01-27 18:40:38 EST
If you have an EL 2.1 webapp deployed on Jetty 9.1 and reference a non-existent variable you get an NPE, which you didn't get in prior versions of Jetty (and Jasper).

Simplest testcase:

Use EL 2.1 in your webapp.
Create a simple 1 line JSP of the following ...

<c:if test="${nonExisting}">Hello,world!</c:if>

and run it.

There appears to have been some bug fixing on the Jasper side for this issue.
Comment 1 Jan Bartel CLA 2014-02-23 19:26:24 EST
*** Bug 428749 has been marked as a duplicate of this bug. ***
Comment 2 Jan Bartel CLA 2014-02-23 19:27:15 EST
Please see issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=428749 for the Glassfish bug tracking issue number.

Jan
Comment 3 Eirik Bjørsnøs CLA 2014-02-24 18:17:14 EST
Patch is now applied upstream:

https://java.net/jira/browse/JSP-39

New JSP release expected in Maven Central "soon":

https://java.net/projects/glassfish/lists/dev/archive/2014-02/message/4
Comment 4 Fritz Richter CLA 2014-04-09 19:22:20 EDT
Is there any workaround for this issue? I want to avoid changing a lot of JSP files by adding an additional ${not empty nonExisting} wrapper. The topic of this issue was "Mixing EL 2.1 and 3.0", where I do not see where the "2.1" is coming from.

Best
fri
Comment 5 Jan Bartel CLA 2014-04-10 04:12:00 EDT
This is fixed in 9.2.0.M0 as we have changed to using apache jasper by default which does not exhibit this bug.

Jan
Comment 6 Fritz Richter CLA 2014-04-10 07:04:22 EDT
That is great, I have read that Jetty 9.2.0 will be released on 04/16/2014, is there a way to download and test the current 9.2.0.M0 right now?
Comment 7 Jan Bartel CLA 2014-04-10 19:47:30 EDT
(In reply to Fritz Richter from comment #6)

Here's the link to the download: 

https://oss.sonatype.org/content/groups/jetty-with-staging/org/eclipse/jetty/jetty-distribution/9.2.0.M0/

cheers
Jan

> That is great, I have read that Jetty 9.2.0 will be released on 04/16/2014,
> is there a way to download and test the current 9.2.0.M0 right now?
Comment 8 Dragan Jotanovic CLA 2014-05-08 10:17:44 EDT
It looks that this is still present in 9.2.0.M0 that is posted to maven central.

Here's the dependecy tree:
+--- org.eclipse.jetty:jetty-jsp:9.2.0.M0
|    +--- org.eclipse.jetty.toolchain:jetty-schemas:3.1.M0
|    +--- javax.servlet:javax.servlet-api:3.1.0
|    +--- javax.servlet.jsp:javax.servlet.jsp-api:2.3.1
|    +--- org.glassfish.web:javax.servlet.jsp:2.3.2
|    |    +--- org.glassfish:javax.el:[3.0.0,) -> 3.0.0
|    |    \--- javax.servlet.jsp:javax.servlet.jsp-api:2.3.1
|    +--- org.eclipse.jetty.orbit:javax.servlet.jsp.jstl:1.2.0.v201105211821
|    +--- org.glassfish.web:javax.servlet.jsp.jstl:1.2.2
|    +--- org.glassfish:javax.el:3.0.0
|    \--- org.eclipse.jetty.orbit:org.eclipse.jdt.core:3.8.2.v20130121

I don't see where is apache jasper in this dependency list

Dragan
Comment 9 Jan Bartel CLA 2014-05-08 11:14:24 EDT
Dragan,

It is fixed in 9.2.0.M0.  That jetty-jsp artifact remains the same, and basically represents the glassfish jsp engine. We have introduced 2 other artifacts that provide apache jsp functionality: http://repo1.maven.org/maven2/org/eclipse/jetty/apache-jsp/, and http://repo1.maven.org/maven2/org/eclipse/jetty/apache-jstl/

The distribution uses apache jsp by preference, and the maven jetty plugins have both been swapped over to use it as well.

regards
Jan
Comment 10 Jan Bartel CLA 2014-05-08 11:17:41 EDT
*** Bug 434427 has been marked as a duplicate of this bug. ***
Comment 11 Dragan Jotanovic CLA 2014-05-08 12:06:20 EDT
Ah, ok, I missed that artifact.

Thanks,
Dragan