Community
Participate
Working Groups
Build Identifier: org.eclipse.jetty:jetty-jsp-2.1:7.5.2-SNAPSHOT doesn't really work very smooth for embedded use. Issue #1: org.glassfish.web:jsp-impl is in provided scope, hence I need to add it to my <dependencies> in my consuming project. Issue #2: Additionally, org.glassfish.web:jsp-impl pulls in a version of the JSP API jar that doesn't include the DTDs for TLDs, hence parsing of taglibs fails. So I need to specify javax.servlet.jsp:jsp-api:2.1 as well to override jsp-impl's version. So my complete Jetty dependency list for use with JSP in a unit test ends up being: <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> <version>7.5.2-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-jsp-2.1</artifactId> <version>7.5.2-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>jsp-impl</artifactId> <version>2.1.3-b10</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>test</scope> </dependency> which is rather long and needs to be checked/updated between Jetty versions. The last two of these could be fixed by making jsp-impl non-provided and by explicitly choosing the 2.1 version of the JSP API. (Which is what jetty-distribution ends up using anyhow..) As a side effect, this would make jsp-impl a transitive dependency inside Jetty as well, so adding it to the aggregate modules would no longer be needed. Reproducible: Always
While we're at it: Might be useful to add one or both of the 1.5 compilers as optional dependencies in jetty-jsp-2.1's pom with comments to add them for JSP to work on Java 5. Alternatively, we could consider adding org.eclipse.jdt.core.compiler:ecj:3.7 as a dependency. People can always exclude it. And this would make jetty-jsp-2.1 more aligned with jetty-distribution. But people also forget to exclude, so this would make Jetty a lot fatter than needed on Java 6 for many embedded use cases. Jan, WDYT? See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=358784
(In reply to comment #1) If we go ahead and make an aggregate for the jsp stuff, or alternatively make the deps for jetty-jsp-2.1 compile rather than provided, then I think we'd go the whole hog and put in the ecj compiler and the jstl jars as well so it would be just like the jetty distro. Having said all of that, we recommend that people move off jdk1.5 to jdk 1.7 because its now a) so old and b) with ssl having being hacked its important to upgrade to 1.7 to get the new TLS libs. Jan > While we're at it: > > Might be useful to add one or both of the 1.5 compilers as optional > dependencies in jetty-jsp-2.1's pom with comments to add them for JSP to work > on Java 5. > > Alternatively, we could consider adding org.eclipse.jdt.core.compiler:ecj:3.7 > as a dependency. People can always exclude it. And this would make > jetty-jsp-2.1 more aligned with jetty-distribution. But people also forget to > exclude, so this would make Jetty a lot fatter than needed on Java 6 for many > embedded use cases. > > Jan, WDYT? > > See also: > https://bugs.eclipse.org/bugs/show_bug.cgi?id=358784
Eirik, In jetty-7.6.1 we have a new module called jetty-jsp, which encapsulates all of the dependencies needed to run jsp. You should just be able to include it into your pom to run jsp embedded - although be sure to read the page http://wiki.eclipse.org/Jetty/Howto/Configure_JSP, particularly the section about JSTL if you're planning on using it. Jan
Thanks Jan, this was exactly what I was looking for! Now I don't need to maintain my own for JettyConsole's JSP plugin and a couple of other use cases anymore: http://simplericity.org/svn/simplericity/trunk/jetty-console/jetty-console-plugins/jetty-console-jsp-plugin/pom.xml (Note that for JettyConsole, where all libraries are actually unpacked inside the META-INF/jettyconsole/lib inside the WAR, I had to do the TLD scanning myself. Nasty, but it works :-) http://simplericity.org/svn/simplericity/trunk/jetty-console/jetty-console-plugins/jetty-console-jsp-plugin/src/main/java/org/simplericity/jettyconsole/jsp/JasperInUnpackedWarUglyHackConfiguration.java
Jan, Shouldn't "src/main/resource" be in plural form "src/main/resources" at http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-jsp/src/main/resource ? Eirik. (In reply to comment #3) > Eirik, > > In jetty-7.6.1 we have a new module called jetty-jsp, which encapsulates all of > the dependencies needed to run jsp. You should just be able to include it into > your pom to run jsp embedded - although be sure to read the page > http://wiki.eclipse.org/Jetty/Howto/Configure_JSP, particularly the section > about JSTL if you're planning on using it. > > Jan
Yup, you're right. Changed it in git. (In reply to comment #5) > Jan, > > Shouldn't "src/main/resource" be in plural form "src/main/resources" at > > http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-jsp/src/main/resource > > ? > > Eirik. > > (In reply to comment #3) > > Eirik, > > > > In jetty-7.6.1 we have a new module called jetty-jsp, which encapsulates all of > > the dependencies needed to run jsp. You should just be able to include it into > > your pom to run jsp embedded - although be sure to read the page > > http://wiki.eclipse.org/Jetty/Howto/Configure_JSP, particularly the section > > about JSTL if you're planning on using it. > > > > Jan