• hessian
  • quercus/php
  • resin 3.0
  • resin 3.1
  • resin 4.0

  • changes
  • configuration
  • examples
  • installing
  • overview
  • starting

  • guide: admin
  • admin
  • amber
  • bam
  • caching
  • clustering
  • comet
  • database
  • deployment
  • ejb 3.0
  • embedding
  • filters
  • ioc
  • jsf
  • jsp
  • logging
  • messaging
  • quercus
  • remoting
  • security
  • resources
  • servlets
  • third-party
  • troubleshooting
  • virtual host
  • watchdog
  • webapp
  • HOME
  • ABOUT
  • ARTICLES
  • WORKSPACE
  • NEWS
  • PROJECTS
  • PRODUCTS
  • STORE
resin jsp, compile, precompile

JSP compilation causes the compilation of JSP files before they are first accessed on a live server.

Command line usage accepts arguments that correspond to the parameters available to the parameters of the JSpCompiler class.

unix> java com.caucho.jsp.JspCompiler -app-dir "/opt/www/foo" test/foo.jsp

com.caucho.jsp.JspCompiler accepts a -conf argument, which points to a web-app configuration.

<web-app xmlns="http://caucho.com/ns/resin"> <document-directory>/opt/www/foo</document-directory> <resin:import path="/opt/resin/conf/app-default.xml"/> </web-app> unix> java com.caucho.jsp.JspCompiler -conf /opt/resin/compile-app.xml" test/foo.jsp
  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • SALES |
  • WIKI
Copyright (c) 1998-2009 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.
  • hessian
  • quercus/php
  • resin 3.0
  • resin 3.1
  • resin 4.0

  • changes
  • configuration
  • examples
  • installing
  • overview
  • starting

  • guide: admin
  • admin
  • amber
  • bam
  • caching
  • clustering
  • comet
  • database
  • deployment
  • ejb 3.0
  • embedding
  • filters
  • ioc
  • jsf
  • jsp
  • logging
  • messaging
  • quercus
  • remoting
  • security
  • resources
  • servlets
  • third-party
  • troubleshooting
  • virtual host
  • watchdog
  • webapp
  • HOME
  • ABOUT
  • ARTICLES
  • WORKSPACE
  • NEWS
  • PROJECTS
  • PRODUCTS
  • STORE

Unless explicitly compiled ahead of time, JSP files are compiled the first time they are accessed. On large production sites, or in situations involving complicated JSP files, compilation may cause unacceptable delays to users first accessing the JSP page.

Resin provides a JspPrecompileListener that causes jsp to be compiled when the web application starts. As an alternative, Resin also provides a JspCompiler that is used to explicitly compile jsp files before they are accessed for the first time.

is a ServletContextListener that compiles jsp files when the web-app starts. It is activated using the <listener> Servlet configuration tag in web.xml.

The following configuration causes Resin to compile all files in the web-app that have an extension of .jsp or .jspx when the application first starts.

<web-app xmlns="http://caucho.com/ns/resin"> <listener> <listener-class>com.caucho.jsp.JspPrecompileListener</listener-class> <init> <extension>jsp</extension> <extension>jspx</extension> </init> </listener> </web-app>

It can also be configured in resin.conf to apply to all web-app's.

<web-app-default> <listener> <listener-class>com.caucho.jsp.JspPrecompileListener</listener-class> <init> <extension>jsp</extension> <extension>jspx</extension> <extension>xtp</extension> </init> </listener> </web-app-default>

You can also use a for more control over which jsp are precompiled:

<web-app> <listener> <listener-class>com.caucho.jsp.JspPrecompileListener</listener-class> <init> <fileset> <include>**/*.jsp</include> <exclude>/a.jsp</exclude> <exclude>/foo/c.jsp</exclude> </fileset> </init> </listener> </web-app> The first line includes all jsp's, it's the same as specifying jsp. The following lines exclude specific jsp.

is used to compile JSP.

class-dirthe destination class directorythe system work path
app-dirthe root directory of an application to compilerequired
xmlif true then XML is the default parserfalse
preludeadd a prelude includenone
codaadd a coda includenone
tagclassname specifying a tag to compilenone
  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • SALES |
  • WIKI
Copyright (c) 1998-2009 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.