[MAGNOLIA-1229] Pre-compile JSPs (but not including them in the bundle) Created: 21/Nov/06  Updated: 23/Jan/13  Resolved: 18/Dec/06

Status: Closed
Project: Magnolia
Component/s: build
Affects Version/s: 3.0 Final
Fix Version/s: 3.0.1, 3.0.2

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MAGNOLIA-1229-usetomcat5028.patch    
Issue Links:
dependency
is depended upon by MAGNOLIA-1266 Use URI instead of urn:jsptld: for ta... Closed
is depended upon by MGNLSD-91 Pre-compile/validate JSPs (but not in... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

As a matter of jdk1.4 compatibility safety, we should try to pre-compile the JSPs of each module, just to make they'll run with 1.4 (see MGNLSD-80)
However, we shouldn't necessarily include the resulting compiled files in the jars - especially since, afaik, these require modifications of the web.xml for them to be used anyways.



 Comments   
Comment by Magnolia International [ 29/Nov/06 ]

the jspc plugin for maven ( http://mojo.codehaus.org/jspc-maven-plugin ) does not work for non-war projects. Should be easy enough to patch and have the patch applied on their svn though.

Comment by Magnolia International [ 05/Dec/06 ]

Currently using a custom snapshot.
See http://jira.codehaus.org/browse/MOJO-578

Comment by Magnolia International [ 05/Dec/06 ]

I tried to have it use tomcat 5.0.28 but this didn't work - possibly due to an incompatibility between the plugin and the jspc api. Should not be too problematic, though - both versions of tomcat comply to the same jsp spec afaik.

[INFO] JSPC Error

Embedded error: Unable to compile class for JSP

Generated servlet error:
The return type is incompatible with JspSourceDependent.getDependants()

Comment by Magnolia International [ 05/Dec/06 ]

This now works (using tomcat 5.5's jspc)

All one needs to add the get the JSPs verified is:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

(done for samples and dms)
This will take care of JSPs in src/main/resources, which is where they should be in a magnolia module. See parent pom.xml for details.

Comment by Magnolia International [ 05/Dec/06 ]

(the "[WARN] Internal Error: File /WEB-INF/web.xml not found" message can safely be disregarded)

Comment by Magnolia International [ 08/Dec/06 ]

Reopening because this doesn't work when building w/ reactor

Comment by Magnolia International [ 11/Dec/06 ]

One of things I noticed while debugging is that the classpath built for the jspc mojo refered to jars, except for the dependencies directly depended upon by the module (adminInterface and the 2 taglibs), which were refered by their target/classes directory. This wasn't deemed normal on irc#maven but we couldn't figure out what was wrong.
OTOH, I now notice, like on MGNLSD-91, that it works if we don't use the urn:jsptld:path notation. As per http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPX3.html , this notation is only valid when the tld file is in WEB-INF/tld. When its bundled in a jar, we should use the <uri> declared in said tld. I'm correcting this locally, and seems to help with precompilation/validation of the jsps.

Comment by Magnolia International [ 12/Dec/06 ]

now works, since MAGNOLIA-1266 was fixed

Comment by Fabrizio Giustina [ 15/Dec/06 ]

Hi Grégory, looks like jsp compilation for dms only works when building the module directly, not during a full magnolia build. Could you give it a try?
I temporarly commented out the jspc plugin in dms for this reason (and, BTW, I just committed your patch for the plugin). Would't be better to replace those jsps in dms with cleaner freemarker templates?

Comment by Magnolia International [ 18/Dec/06 ]

I'll look at it, but note that dms has been removed from the reactor build, as it now has its own lifecycle and will be moved to community modules soon.

Comment by Magnolia International [ 18/Dec/06 ]

Removed the usage of a non-used taglib and it now works. Not sure it's really related, but that's all I could do/see.

Generated at Mon Feb 12 03:24:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.