Class EmbeddedServletOptions

java.lang.Object
org.apache.jasper.EmbeddedServletOptions
All Implemented Interfaces:
Options

public final class EmbeddedServletOptions extends Object implements Options
A class to hold all init parameters specific to the JSP engine.
  • Field Details

    • fork

      public boolean fork
      Should Ant fork its java compiles of JSP pages.
  • Constructor Details

    • EmbeddedServletOptions

      public EmbeddedServletOptions(ServletConfig config, ServletContext context)
      Create an EmbeddedServletOptions object using data available from ServletConfig and ServletContext.
      Parameters:
      config - The Servlet config
      context - The Servlet context
  • Method Details

    • getProperty

      public String getProperty(String name)
      Gets the value of the named property from the underlying settings.
      Parameters:
      name - the property name
      Returns:
      the property value, or null if not set
    • setProperty

      public void setProperty(String name, String value)
      Sets the value of the named property in the underlying settings.
      Parameters:
      name - the property name
      value - the property value
    • setQuoteAttributeEL

      public void setQuoteAttributeEL(boolean b)
      Sets whether quoting rules from JSP.1.6 are applied to EL expressions in attributes.
      Parameters:
      b - true to enable quoting rules
    • getQuoteAttributeEL

      public boolean getQuoteAttributeEL()
      Description copied from interface: Options
      Returns whether quoting rules from JSP.1.6 are applied to EL expressions in attributes.
      Specified by:
      getQuoteAttributeEL in interface Options
      Returns:
      true if EL expressions used within attributes should have the quoting rules in JSP.1.6 applied to the expression.
    • getKeepGenerated

      public boolean getKeepGenerated()
      Description copied from interface: Options
      Returns whether the generated Java source files should be kept after compilation.
      Specified by:
      getKeepGenerated in interface Options
      Returns:
      true to keep the generated source
    • getTrimSpaces

      public TrimSpacesOption getTrimSpaces()
      Description copied from interface: Options
      Returns the option for trimming whitespace-only template text.
      Specified by:
      getTrimSpaces in interface Options
      Returns:
      TrimSpacesOption.TRUE to remove template text that consists only of whitespace from the output completely, TrimSpacesOption.SINGLE to replace such template text with a single space, TrimSpacesOption.FALSE to leave such template text unchanged or TrimSpacesOption.EXTENDED to remove template text that consists only of whitespace and to replace any sequence of whitespace and new lines within template text with a single new line.
    • isPoolingEnabled

      public boolean isPoolingEnabled()
      Description copied from interface: Options
      Returns whether tag handler pooling is enabled for improved performance.
      Specified by:
      isPoolingEnabled in interface Options
      Returns:
      true if tag handler pooling is enabled, false otherwise.
    • getMappedFile

      public boolean getMappedFile()
      Description copied from interface: Options
      Returns whether HTML mapped Servlets are supported.
      Specified by:
      getMappedFile in interface Options
      Returns:
      true if HTML mapped Servlets are supported.
    • getClassDebugInfo

      public boolean getClassDebugInfo()
      Description copied from interface: Options
      Returns whether debug information is included in compiled classes.
      Specified by:
      getClassDebugInfo in interface Options
      Returns:
      true if debug information in included in compiled classes.
    • getCheckInterval

      public int getCheckInterval()
      Description copied from interface: Options
      Returns the interval in seconds at which the background compile thread checks for modified JSP files.
      Specified by:
      getCheckInterval in interface Options
      Returns:
      background compile thread check interval in seconds
    • getModificationTestInterval

      public int getModificationTestInterval()
      Description copied from interface: Options
      Returns the interval in seconds between modification tests for JSP files.
      Specified by:
      getModificationTestInterval in interface Options
      Returns:
      modification test interval in seconds.
    • getRecompileOnFail

      public boolean getRecompileOnFail()
      Description copied from interface: Options
      Returns whether the JSP engine should attempt re-compilation when an initial compilation fails.
      Specified by:
      getRecompileOnFail in interface Options
      Returns:
      true if re-compile will occur on a failure.
    • getDevelopment

      public boolean getDevelopment()
      Description copied from interface: Options
      Main development flag, which enables detailed error reports with sources, as well automatic recompilation of JSPs and tag files. This setting should usually be false when running in production.
      Specified by:
      getDevelopment in interface Options
      Returns:
      true if Jasper is in development mode
    • isSmapSuppressed

      public boolean isSmapSuppressed()
      Description copied from interface: Options
      Returns whether generation of SMAP (Source Map for Debugging) information is suppressed.
      Specified by:
      isSmapSuppressed in interface Options
      Returns:
      true to suppress generation of SMAP info for JSR45 debugging.
    • isSmapDumped

      public boolean isSmapDumped()
      Description copied from interface: Options
      This setting is ignored if suppressSmap() is true.
      Specified by:
      isSmapDumped in interface Options
      Returns:
      true to write SMAP info for JSR45 debugging to a file.
    • genStringAsCharArray

      public boolean genStringAsCharArray()
      Description copied from interface: Options
      Indicates whether text strings are to be generated as char arrays.
      Specified by:
      genStringAsCharArray in interface Options
      Returns:
      true if text strings are to be generated as char arrays, false otherwise
    • getScratchDir

      public File getScratchDir()
      Description copied from interface: Options
      Returns the scratch directory used as the work folder for temporary compilation files.
      Specified by:
      getScratchDir in interface Options
      Returns:
      the work folder
    • getClassPath

      public String getClassPath()
      Description copied from interface: Options
      Returns the classpath used by the compiler when compiling generated Servlets.
      Specified by:
      getClassPath in interface Options
      Returns:
      the classpath used to compile generated Servlets
    • isXpoweredBy

      public boolean isXpoweredBy()
      Description copied from interface: Options
      Returns whether the X-Powered-By response header should be generated in HTTP responses.
      Specified by:
      isXpoweredBy in interface Options
      Returns:
      true to generate a X-Powered-By response header.
    • getCompiler

      public String getCompiler()
      Description copied from interface: Options
      Compiler to use.

      If null (the default), the java compiler from Eclipse JDT project, bundled with Tomcat, will be used. Otherwise, the javac task from Apache Ant will be used to call an external java compiler and the value of this option will be passed to it. See Apache Ant documentation for the possible values.

      Specified by:
      getCompiler in interface Options
      Returns:
      the compiler name
    • getCompilerTargetVM

      public String getCompilerTargetVM()
      Description copied from interface: Options
      Returns the target Java VM version for the compiler, such as 1.8.
      Specified by:
      getCompilerTargetVM in interface Options
      Returns:
      the compiler target VM, e.g. 1.8.
    • getCompilerSourceVM

      public String getCompilerSourceVM()
      Description copied from interface: Options
      Returns the source Java VM version for the compiler, such as 1.8.
      Specified by:
      getCompilerSourceVM in interface Options
      Returns:
      the compiler source VM, e.g. 1.8.
    • getCompilerClassName

      public String getCompilerClassName()
      Description copied from interface: Options
      Returns the fully qualified class name of the Jasper Java compiler implementation to use.
      Specified by:
      getCompilerClassName in interface Options
      Returns:
      Jasper Java compiler class to use.
    • getErrorOnUseBeanInvalidClassAttribute

      public boolean getErrorOnUseBeanInvalidClassAttribute()
      Description copied from interface: Options
      Returns true if Jasper issues a compilation error instead of a runtime Instantiation error if the class attribute specified in useBean action is invalid.
      Specified by:
      getErrorOnUseBeanInvalidClassAttribute in interface Options
      Returns:
      true to get an error
    • setErrorOnUseBeanInvalidClassAttribute

      public void setErrorOnUseBeanInvalidClassAttribute(boolean b)
      Sets whether to error on invalid class attribute in jsp:useBean.
      Parameters:
      b - true to enable error checking
    • getTldCache

      public TldCache getTldCache()
      Description copied from interface: Options
      The cache that maps URIs, resource paths and parsed TLD files for the various tag libraries 'exposed' by the web application. A tag library is 'exposed' either explicitly in web.xml or implicitly via the uri tag in the TLD of a taglib deployed in a jar file (WEB-INF/lib).
      Specified by:
      getTldCache in interface Options
      Returns:
      the instance of the TldCache for the web-application.
    • setTldCache

      public void setTldCache(TldCache tldCache)
      Sets the TLD cache instance.
      Parameters:
      tldCache - the TLD cache to use
    • getJavaEncoding

      public String getJavaEncoding()
      Description copied from interface: Options
      Returns the Java platform character encoding used when generating the JSP page servlet source.
      Specified by:
      getJavaEncoding in interface Options
      Returns:
      Java platform encoding to generate the JSP page servlet.
    • getFork

      public boolean getFork()
      Description copied from interface: Options
      The boolean flag to tell Ant whether to fork JSP page compilations.

      Is used only when Jasper uses an external java compiler (wrapped through a javac Apache Ant task).

      Specified by:
      getFork in interface Options
      Returns:
      true to fork a process during compilation
    • getJspConfig

      public JspConfig getJspConfig()
      Description copied from interface: Options
      Returns the JSP configuration information as specified in the web.xml deployment descriptor.
      Specified by:
      getJspConfig in interface Options
      Returns:
      JSP configuration information specified in web.xml.
    • getTagPluginManager

      public TagPluginManager getTagPluginManager()
      Description copied from interface: Options
      Returns the Tag Plugin Manager used for applying tag plugins during JSP compilation.
      Specified by:
      getTagPluginManager in interface Options
      Returns:
      a Tag Plugin Manager
    • isCaching

      public boolean isCaching()
      Description copied from interface: Options
      Returns whether caching is enabled for compiled JSP pages, used for precompilation scenarios.
      Specified by:
      isCaching in interface Options
      Returns:
      true if caching is enabled (used for precompilation).
    • getCache

      public Map<String, TagLibraryInfo> getCache()
      Description copied from interface: Options
      The web-application wide cache for the TagLibraryInfo tag library descriptors, used if Options.isCaching() returns true.

      Using this cache avoids the cost of repeating the parsing of a tag library descriptor XML file (performed by TagLibraryInfoImpl.parseTLD).

      Specified by:
      getCache in interface Options
      Returns:
      the Map(String uri, TagLibraryInfo tld) instance.
    • getDisplaySourceFragment

      public boolean getDisplaySourceFragment()
      Description copied from interface: Options
      Returns whether a source fragment should be included in exception messages for debugging.
      Specified by:
      getDisplaySourceFragment in interface Options
      Returns:
      true to include a source fragment in exception messages.
    • getMaxLoadedJsps

      public int getMaxLoadedJsps()
      Description copied from interface: Options
      The maximum number of loaded jsps per web-application. If there are more jsps loaded, they will be unloaded. If unset or less than 0, no jsps are unloaded.
      Specified by:
      getMaxLoadedJsps in interface Options
      Returns:
      The JSP count
    • getJspIdleTimeout

      public int getJspIdleTimeout()
      Description copied from interface: Options
      Returns the idle timeout for JSP unloading.
      Specified by:
      getJspIdleTimeout in interface Options
      Returns:
      the idle time in seconds after which a JSP is unloaded. If unset or less or equal than 0, no jsps are unloaded.
    • getStrictQuoteEscaping

      public boolean getStrictQuoteEscaping()
      Description copied from interface: Options
      Returns whether strict quote escaping is enabled for scriplet expressions.
      Specified by:
      getStrictQuoteEscaping in interface Options
      Returns:
      true if the quote escaping required by section JSP.1.6 of the JSP specification should be applied to scriplet expression.
    • getVariableForExpressionFactory

      public String getVariableForExpressionFactory()
      Description copied from interface: Options
      Returns the variable name used in the generated JSP servlet code to reference the EL expression factory.
      Specified by:
      getVariableForExpressionFactory in interface Options
      Returns:
      the name of the variable that will be used in the generated JSP code for the expression factory
    • getVariableForInstanceManager

      public String getVariableForInstanceManager()
      Description copied from interface: Options
      Returns the variable name used in the generated JSP servlet code to reference the instance manager.
      Specified by:
      getVariableForInstanceManager in interface Options
      Returns:
      the name of the variable that will be used in the generated JSP code for the instance manager
    • getPoolTagsWithExtends

      public boolean getPoolTagsWithExtends()
      Description copied from interface: Options
      Returns whether tag pooling is allowed on JSP pages that use the extends directive.
      Specified by:
      getPoolTagsWithExtends in interface Options
      Returns:
      true if tag pooling is disabled with page that uses extends.
    • getStrictGetProperty

      public boolean getStrictGetProperty()
      Description copied from interface: Options
      Returns whether strict enforcement of the JSP.5.3 requirement is applied, requiring objects used in jsp:getProperty to be previously introduced to the JSP processor.
      Specified by:
      getStrictGetProperty in interface Options
      Returns:
      true if the requirement to have the object used in jsp:getProperty action to be previously "introduced" to the JSP processor (see JSP.5.3) is enforced.
    • getStrictWhitespace

      public boolean getStrictWhitespace()
      Description copied from interface: Options
      Returns whether strict whitespace handling rules are applied during JSP compilation.
      Specified by:
      getStrictWhitespace in interface Options
      Returns:
      true if the strict white space rules are applied.
    • getJspServletBase

      public String getJspServletBase()
      Description copied from interface: Options
      Returns the default base class for generated JSP servlets.
      Specified by:
      getJspServletBase in interface Options
      Returns:
      the default base class for generated JSP Servlets
    • getServiceMethodName

      public String getServiceMethodName()
      Description copied from interface: Options
      _jspService is the name of the method that is called by HttpJspBase.service(). This is where most of the code generated from JSPs go.
      Specified by:
      getServiceMethodName in interface Options
      Returns:
      the method name
    • getServletClasspathAttribute

      public String getServletClasspathAttribute()
      Description copied from interface: Options
      Returns the ServletContext attribute name used for the classpath.
      Specified by:
      getServletClasspathAttribute in interface Options
      Returns:
      ServletContext attribute for classpath. This is tomcat specific. Other servlet engines may choose to support this attribute if they want to have this JSP engine running on them.
    • getJspPrecompilationQueryParameter

      public String getJspPrecompilationQueryParameter()
      Description copied from interface: Options
      Returns the query parameter name that triggers JSP pre-compilation.
      Specified by:
      getJspPrecompilationQueryParameter in interface Options
      Returns:
      The query parameter that causes the JSP engine to just pregenerated the servlet but not invoke it.
    • getGeneratedJspPackageName

      public String getGeneratedJspPackageName()
      Description copied from interface: Options
      Returns the default package name for compiled JSP pages.
      Specified by:
      getGeneratedJspPackageName in interface Options
      Returns:
      The default package name for compiled jsp pages.
    • getGeneratedTagFilePackageName

      public String getGeneratedTagFilePackageName()
      Description copied from interface: Options
      Returns the default package name for tag handlers generated from tag files.
      Specified by:
      getGeneratedTagFilePackageName in interface Options
      Returns:
      The default package name for tag handlers generated from tag files.
    • getTempVariableNamePrefix

      public String getTempVariableNamePrefix()
      Description copied from interface: Options
      Returns the prefix used for generated temporary variable names.
      Specified by:
      getTempVariableNamePrefix in interface Options
      Returns:
      Prefix to use for generated temporary variable names
    • getUseInstanceManagerForTags

      public boolean getUseInstanceManagerForTags()
      Description copied from interface: Options
      Returns whether the container instance manager is used to create tag bean instances.
      Specified by:
      getUseInstanceManagerForTags in interface Options
      Returns:
      true if the container instance manager will be used to create the bean instances
    • getUseNonstandardTagOptimizations

      public String getUseNonstandardTagOptimizations()
      Description copied from interface: Options
      A string containing a comma-separated list of names to which custom tag implementations should be applied. Unknown or unused tag entries are harmless. Generally defined via an init parameter on the JspServlet.
      Specified by:
      getUseNonstandardTagOptimizations in interface Options
      Returns:
      which tags to use