Yes, you can use the jspc task in ant to precompile your jsp files into .java files. You can also postcompile those .java files into .class files. Read this link:
http://ant.apache.org/manual/OptionalTasks/jspc.html However, I'll warn you that jspc will create the proper directory structure including subdirectories, but it doesn't put subdirectory information into the .java package declaration. Everything is stuffed into a single package. This means that if you have
maindir/subdir1/index.jsp
and
maindir/subdir2/index.jsp, you'll end up with 2
index_jsp.java files which BOTH have package
maindir. subdir1 and subdir2 won't be put into the package name.
If anyone knows how to get around this, please shout!