Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic