tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject JSP Precompilation and Servlet 3.0
Date Fri, 05 Nov 2010 14:13:50 GMT
-----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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message