aspose file tools*
The moose likes JSP and the fly likes Is it better to ship WAR with class files of JSPs, instead of JSPs themselves? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Is it better to ship WAR with class files of JSPs, instead of JSPs themselves?" Watch "Is it better to ship WAR with class files of JSPs, instead of JSPs themselves?" New topic
Author

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

ron sean
Greenhorn

Joined: May 01, 2012
Posts: 1
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

Joined: Jan 10, 2002
Posts: 60050
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
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

Joined: Jan 10, 2002
Posts: 60050
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it better to ship WAR with class files of JSPs, instead of JSPs themselves?
 
Similar Threads
Deploying Precompiled JSPs on iPlanet
about .jspf files
JSP Deployment using Tomcat
Precompiling JSP using org.apache.jasper.JspC and configuring XML
precompiling Tiles JSP in Tomcat