While I like the idea of using web-fragment.xml for precompiled jsp's - it would require the "meta-data complete" flag to be set to false which may as a side effect allow other artifacts to be loaded too.

Hopefully jsp-precompile is part of the webapp build/deploy process so a developer can ignore it during development. But an admin (or release manager) can ensure that all jsps do compile before release is deployed.

Setting up jsp-precompilation is a PITA the first time or 2 but once you get the hang of it, the precompilation step can be part of a standard snippet which can be pulled in via ant import. (For those of us who love ant)

-Tim

On 11/5/2010 10:13 AM, Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

All,

Tim has just given his talk at ApacheCon NA about Servlet 3.0 / Tomcat
7.0. It was really my first taste of the 3.0 spec and I had a thought
about the new features available for webapp configuration /other/ than
web.xml:

- - web.xml fragments
- - class annotations

The current method for JSP precompilation (which I've never used, mind
you, so forgive my ignorance if I'm incorrect) is cumbersome:

- - run the compiler
- - copy the new .class files somewhere
- - drop a huge load of junk into web.xml

It occurred to me that that these new servlet 3.0 features could help
JSP precompilation. Let's see what Tomcat 7.0's JSP precompiler could do
(roughly):

$ jsp-precompile /path/to/jsps my-jsps.jar
$ cp my-jsps.jar /path/to/webapps/mywebapp/WEB-INF/lib

(done)

The precompiler could translate and compile all of the classes and
package them into a .jar file for you. Great. What about servlet
mappings? Well, we have two options:

1. Use annotations in the translated .java files
2. Generate a web.xml fragment and stuff it into
    my-jsps.jar/WEB-INF/web-fragment.xml

Does anyone have any preferences? I suppose it could be an option to the
precompiler, or we could even do both (do duplicate mappings conflict?).

Hopefully, this will make JSP precompilation less onerous for users.

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzUER4ACgkQ9CaO5/Lv0PCfUgCgtgRRQd+Qw6X2aLDWyHq0STbd
UzgAnR7DtoAKbzLOdRSLWFPX4Qjp9UN5
=k337
-----END PGP SIGNATURE-----

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




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

Reply via email to