dev@glassfish.java.net

libraries added to classpath when using deploy subcommand's --precompilejsp option

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Wed, 22 Apr 2009 10:00:14 +1000

Hi Siva, Kin-man,

I have a question about a piece of code in GF V2.1's ASClassLoaderUtil.java.

When using the deploy subcommand's --precompilejsp option, the following
method looks up the libraries specified to the --libraries option.
com.sun.appserv.server.util.ASClassLoaderUtil#getWebModuleClassPath(String)

The way it does that seems to depend on whether you're compiling an EAR
or WAR file:

In case of an EAR:
  It obtains the <display-name> from application.xml, and uses this as
key to search all deployed WAR files and for each match adds the jar
files that were set for it to the classpath.

In case of a WAR:
  It obtains the module's destination path
(("C:glassfish\domains\domain1\applications\j2ee-modules\sample"),
converts '\'s to '-'s, and uses that as key to search all deployed WAR
files and for each match adds the jar files that were set for it to the
classpath.

Is it supposed to be relying on the <display-name> value?

It seems the --libraries are already obtained and passed to the
JSPCompiler#compile method's classpathList argument, so is the above
processing in that method really needed?

I also had a look at the V3 source but this class has been refactored so
I'm not sure whether it has been taken out or just moved elsewhere.
Taking it out would be the right approach, wouldn't it?

Thanks,
Dies