• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it better to ship WAR with class files of JSPs, instead of JSPs themselves?

 
ron sean
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we can make Tomcat/Jasper compile JSPs using an ANT task, wouldn't it better to ship the WAR with pre-compiled JSP class files, rather than JSPs themselves?

That way, we are not tied down with Weblogic/Webshere JSP compilation issues. All that they would get are 'class' files.

I think this would need that the "jsp" servlet would have to be turned off somehow. And the Spring/Struts Servlet will have to enabled to handle 'jsp' extension.

What I am thinking is that: Pre-compile JSPs > to Java > to Class files, using Jasper. And then package Jasper JAR(s) with my WAR file's WEB-INF/lib.

What do you think? And what is the more commonly done thing in other production environments?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't use either of Websphere or Weblogic if you paid me, so I don't what issues you are trying to circumvent. I've never had any problems using plain old JSPs in deployments to Tomcat or Resin.
 
Stefan Evans
Bartender
Posts: 1784
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I don't think that would work.

The compiled JSP files depend on the Tomcat libraries. As such they wouldn't work on other servlet containers.


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It most certainly would not work.

If the container you will deploying in does not provide any pre-compiling options, you're stuck with just shipping the JSPs, which is what is usually done anyways.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic