• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic