aspose file tools*
The moose likes JSP and the fly likes Is it possible to dispatch a JSP from a JAR file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Is it possible to dispatch a JSP from a JAR file?" Watch "Is it possible to dispatch a JSP from a JAR file?" New topic
Author

Is it possible to dispatch a JSP from a JAR file?

Chris Corbyn
Ranch Hand

Joined: Jan 14, 2007
Posts: 114
I'm wondering how far I can separate some concerns in some code I'm writing here. It would be quite useful if there was a way to put some JSP templates inside a JAR file along with their associcated classes and then be able to getRequestDispatcher("/somewhere/in/jar/file.jsp").forward( ... );. Is there a way to handle that?

I'm not looking for a WAR file though... this will basically be support code which just sits in lib.

Cheers,

Chris
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you pre-compile your JSPs you could store the class files in a jar and map them the same way you would any other servlet.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Chris Corbyn
Ranch Hand

Joined: Jan 14, 2007
Posts: 114
Hmm, I never thought of doing that, thanks. Actually I may have to change some code (for the better) to take this sort of thing into account.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to dispatch a JSP from a JAR file?