Changeset 7608


Ignore:
Timestamp:
Feb 27, 2019, 9:37:41 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2151: Pre-compile all JSP pages before releases

After testing a live Tomcat installation it was noted that some JSP files would not compile even though the pre-compilation worked. Investigations discovered that Tomcat has a default setting to compile with source/target version set to 1.7. Setting the same version when pre-compiling resulted in the same errors. To solve this we need to override the global *.jsp servlet declaration in our own web.xml. Here we can also include the 'strictQuoteEscaping' parameter so we should not have to configure this during the installation.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r7600 r7608  
    7878  <property name="jsp.xlint" value="all,-serial"
    7979    description="Xlint parameter when compiling JSP files (-serial is needed since jasper doesn't generate a serialVersionUID)" />
     80  <!-- NOTE! Source and Target versions are also in the config/dist/web.xml for the JSP servlet declaration -->
     81  <!-- If the values are changed here, they should also be changed in web.xml -->
    8082  <property name="javac.source" value="1.8"
    8183    description="Default value for the 'source' attribute when compiling java code" />
  • trunk/config/dist/web.xml

    r7428 r7608  
    235235    <url-pattern>/extensions/servlet/*</url-pattern>
    236236  </servlet-mapping>
     237
     238  <!-- Replaces the default *.jsp servlet mapping in the global web.xml -->
     239  <!-- Our JSP:s will not compile unless:   -->
     240  <!-- strictQuoteEscaping=false (default is true)-->
     241  <!-- compilerSourceVM=1.8 (default is 1.7) -->
     242  <!-- compilerTargetVM=1.8 (default is 1.7) -->
     243  <servlet>
     244    <servlet-name>jsp</servlet-name>
     245    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
     246    <init-param>
     247      <param-name>strictQuoteEscaping</param-name>
     248      <param-value>false</param-value>
     249    </init-param>
     250    <init-param>
     251      <param-name>compilerSourceVM</param-name>
     252      <param-value>1.8</param-value>
     253    </init-param>
     254    <init-param>
     255      <param-name>compilerTargetVM</param-name>
     256      <param-value>1.8</param-value>
     257    </init-param>
     258    <init-param>
     259      <param-name>fork</param-name>
     260      <param-value>false</param-value>
     261    </init-param>
     262    <init-param>
     263      <param-name>xpoweredBy</param-name>
     264      <param-value>false</param-value>
     265    </init-param>
     266    <load-on-startup>3</load-on-startup>
     267  </servlet>
    237268 
    238269  <!-- Mapping *.xjsp files to a custom JSP compiler that adds extension JAR file to classpath -->
     
    246277        <servlet-name>xjsp</servlet-name>
    247278        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
     279    <init-param>
     280      <param-name>strictQuoteEscaping</param-name>
     281      <param-value>false</param-value>
     282    </init-param>
     283    <init-param>
     284      <param-name>compilerSourceVM</param-name>
     285      <param-value>1.8</param-value>
     286    </init-param>
     287    <init-param>
     288      <param-name>compilerTargetVM</param-name>
     289      <param-value>1.8</param-value>
     290    </init-param>
    248291        <init-param>
    249292            <param-name>fork</param-name>
Note: See TracChangeset for help on using the changeset viewer.