https://issues.apache.org/bugzilla/show_bug.cgi?id=50895

Andy Wang <do...@moonteeth.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #3 from Andy Wang <do...@moonteeth.com> 2011-03-08 18:05:16 EST ---
I haven't coded this up, here's a simple example:

my.jsp page that contians the following

MyClass class = new MyClass();

MyClass contains the following code

 static {
     File file = new File("/path/to/file/that/only/exists/at/runtime");
     if (!file.exists()) {
        throw new Exception();
     }
 }


my.jsp is perfectly valid to precompile in this case, but precompilation using
the Jspc ant task will fail because the instantiation of MyClass will fail due
to the file that doesn't exist.

While this is a horrible example and I won't argue the coding pattern isn't
ideal, we have a couple of cases where a jsp page relies on a class that has a
static constructor that has runtime dependencies.  As a result, we are unable
to precompile the jsps without patching tomcat and making the initialize flag
false.

The other thing.  All of our JSPs takes 96 minutes to pre-compile with 6.0.32.
Took about an hour with 6.0.28.  With the initialize set to false it's
somewhere in between.  The initialization step of some of our classes with 
complicated static initializers can be time consuming.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to