Changeset 2aceca5 for apps


Ignore:
Timestamp:
Mar 14, 2018 6:33:14 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
00dc1ed
Parents:
b9d5cdf
Message:

Console: Add error handler to all webapps (ticket #2155)
Fix up default servlet handling in i2ptunnel and susidns

Location:
apps
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/web.xml

    rb9d5cdf r2aceca5  
    1919     <load-on-startup>1</load-on-startup>
    2020    </servlet>
     21
     22    <servlet>
     23      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     24      <servlet-class>net.i2p.servlet.ErrorServlet</servlet-class>
     25      <init-param>
     26        <param-name>name</param-name>
     27        <param-value>I2PSnark</param-value>
     28      </init-param>
     29    </servlet>
    2130     
    2231    <!-- precompiled servlets -->
     
    2534      <servlet-name>org.klomp.snark.web.I2PSnarkServlet</servlet-name>
    2635      <url-pattern>/</url-pattern>
     36    </servlet-mapping>
     37
     38    <servlet-mapping>
     39      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     40      <url-pattern>/.error</url-pattern>
    2741    </servlet-mapping>
    2842   
     
    3751    </session-config>
    3852
     53    <error-page>
     54        <error-code>403</error-code>
     55        <location>/.error</location>
     56    </error-page>
     57    <error-page>
     58        <error-code>404</error-code>
     59        <location>/.error</location>
     60    </error-page>
     61    <error-page>
     62        <error-code>500</error-code>
     63        <location>/.error</location>
     64    </error-page>
    3965</web-app>
  • apps/i2ptunnel/jsp/web.xml

    rb9d5cdf r2aceca5  
    1414    </filter-mapping>
    1515
     16    <servlet>
     17      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     18      <servlet-class>net.i2p.servlet.ErrorServlet</servlet-class>
     19      <init-param>
     20        <param-name>name</param-name>
     21        <param-value>Hidden Services Manager</param-value>
     22      </init-param>
     23    </servlet>
     24
    1625    <!-- precompiled servlets -->
    1726
     
    1928    <servlet-mapping>
    2029        <servlet-name>net.i2p.i2ptunnel.jsp.index_jsp</servlet-name>
    21         <!-- this becomes the default so it also covers /index and /index.html -->
    22         <url-pattern>/</url-pattern>
     30        <!-- empty pattern handles the root -->
     31        <url-pattern></url-pattern>
     32    </servlet-mapping>
     33
     34    <servlet-mapping>
     35        <servlet-name>net.i2p.i2ptunnel.jsp.index_jsp</servlet-name>
     36        <url-pattern>/index</url-pattern>
     37    </servlet-mapping>
     38
     39    <servlet-mapping>
     40        <servlet-name>net.i2p.i2ptunnel.jsp.index_jsp</servlet-name>
     41        <url-pattern>/index.html</url-pattern>
    2342    </servlet-mapping>
    2443
     
    3857    </servlet-mapping>
    3958
     59    <servlet-mapping>
     60      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     61      <url-pattern>/error</url-pattern>
     62    </servlet-mapping>
     63
    4064    <!-- this webapp doesn't actually use sessions or cookies -->
    4165    <session-config>
     
    5175        <welcome-file>index.jsp</welcome-file>
    5276    </welcome-file-list>
     77
     78    <error-page>
     79        <error-code>403</error-code>
     80        <location>/error</location>
     81    </error-page>
     82    <error-page>
     83        <error-code>404</error-code>
     84        <location>/error</location>
     85    </error-page>
     86    <error-page>
     87        <error-code>500</error-code>
     88        <location>/error</location>
     89    </error-page>
    5390</web-app>
  • apps/imagegen/imagegen/webapp/src/main/webapp/WEB-INF/web.xml

    rb9d5cdf r2aceca5  
    2222     <load-on-startup>1</load-on-startup>
    2323    </servlet>
    24      
     24
     25    <servlet>
     26      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     27      <servlet-class>net.i2p.servlet.ErrorServlet</servlet-class>
     28      <init-param>
     29        <param-name>name</param-name>
     30        <param-value>imagegen</param-value>
     31      </init-param>
     32    </servlet>
     33
    2534    <!-- precompiled servlets -->
    2635   
     
    3948      <url-pattern>/ra</url-pattern>
    4049    </servlet-mapping>
     50
     51    <servlet-mapping>
     52      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     53      <url-pattern>/error</url-pattern>
     54    </servlet-mapping>
     55     
    4156   
    4257    <!-- this webapp doesn't actually use sessions or cookies -->
     
    5065    </session-config>
    5166
     67    <error-page>
     68        <error-code>403</error-code>
     69        <location>/error</location>
     70    </error-page>
     71    <error-page>
     72        <error-code>404</error-code>
     73        <location>/error</location>
     74    </error-page>
     75    <error-page>
     76        <error-code>500</error-code>
     77        <location>/error</location>
     78    </error-page>
     79
    5280</web-app>
  • apps/susidns/src/WEB-INF/web-template.xml

    rb9d5cdf r2aceca5  
    2828      <servlet-name>i2p.susi.dns.TranslateSVGServlet</servlet-name>
    2929      <servlet-class>i2p.susi.dns.TranslateSVGServlet</servlet-class>
     30    </servlet>
     31
     32    <servlet>
     33      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     34      <servlet-class>net.i2p.servlet.ErrorServlet</servlet-class>
     35      <init-param>
     36        <param-name>name</param-name>
     37        <param-value>Addressbook</param-value>
     38      </init-param>
    3039    </servlet>
    3140
     
    6574
    6675    <servlet-mapping>
     76        <servlet-name>i2p.susi.dns.jsp.index_jsp</servlet-name>
     77        <url-pattern>/index.html</url-pattern>
     78    </servlet-mapping>
     79
     80    <servlet-mapping>
     81        <servlet-name>i2p.susi.dns.jsp.index_jsp</servlet-name>
     82        <!-- empty pattern handles the root -->
     83        <url-pattern></url-pattern>
     84    </servlet-mapping>
     85
     86    <servlet-mapping>
    6787        <servlet-name>i2p.susi.dns.jsp.export_jsp</servlet-name>
    6888        <url-pattern>/export</url-pattern>
     
    7292      <servlet-name>i2p.susi.dns.TranslateSVGServlet</servlet-name>
    7393      <url-pattern>/images/*</url-pattern>
     94    </servlet-mapping>
     95
     96    <servlet-mapping>
     97      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     98      <url-pattern>/error</url-pattern>
    7499    </servlet-mapping>
    75100
     
    84109    </welcome-file-list>
    85110
     111    <error-page>
     112        <error-code>403</error-code>
     113        <location>/error</location>
     114    </error-page>
     115    <error-page>
     116        <error-code>404</error-code>
     117        <location>/error</location>
     118    </error-page>
     119    <error-page>
     120        <error-code>500</error-code>
     121        <location>/error</location>
     122    </error-page>
     123
    86124</web-app>
  • apps/susidns/src/build.xml

    rb9d5cdf r2aceca5  
    107107                <fileset dir=".">
    108108                        <include name="WEB-INF/**/*.class"/>
    109                         <include name="index.html"/>
    110109                        <include name="svg/*"/>
    111110                </fileset>
     
    124123    <target name="warUpToDate">
    125124        <uptodate property="war.uptodate" targetfile="${project}.war">
    126             <srcfiles dir= "." includes="WEB-INF/web-out.xml WEB-INF/**/*.class svg/* index.html" />
     125            <srcfiles dir= "." includes="WEB-INF/web-out.xml WEB-INF/**/*.class svg/*" />
    127126        </uptodate>
    128127        <condition property="shouldListChanges" >
  • apps/susimail/src/WEB-INF/web.xml

    rb9d5cdf r2aceca5  
    2424    </multipart-config>
    2525  </servlet>
     26
     27  <servlet>
     28    <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     29    <servlet-class>net.i2p.servlet.ErrorServlet</servlet-class>
     30    <init-param>
     31      <param-name>name</param-name>
     32      <param-value>SusiMail</param-value>
     33    </init-param>
     34  </servlet>
     35
    2636  <servlet-mapping>
    2737    <servlet-name>SusiMail</servlet-name>
    2838    <url-pattern>/susimail</url-pattern>
    2939  </servlet-mapping>
     40
     41  <servlet-mapping>
     42    <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
     43    <url-pattern>/error</url-pattern>
     44  </servlet-mapping>
     45
    3046  <session-config>
    3147    <session-timeout>1440</session-timeout>
     
    4965  </context-param>
    5066
    51 <!--
    52      Jetty 6 mulipart form handling
    53      See http://docs.codehaus.org/display/JETTY/File+Upload+in+jetty6
    54      and RequestWrapper.java.
    55      Unused because it doesn't support content-type until Jetty 8.
    56 
    57     <filter>
    58         <filter-name>fileuploadfilter</filter-name>
    59         <filter-class>org.mortbay.servlet.MultiPartFilter</filter-class>
    60         <init-param>
    61             <param-name>deleteFiles</param-name>
    62             <param-value>true</param-value>
    63         </init-param>
    64     </filter>
    65 
    66     <filter-mapping>
    67         <filter-name>fileuploadfilter</filter-name>
    68         <url-pattern>/susimail</url-pattern>
    69     </filter-mapping>
    70 -->
     67  <error-page>
     68    <error-code>403</error-code>
     69    <location>/error</location>
     70  </error-page>
     71  <error-page>
     72    <error-code>404</error-code>
     73    <location>/error</location>
     74  </error-page>
     75  <error-page>
     76    <error-code>500</error-code>
     77    <location>/error</location>
     78  </error-page>
    7179
    7280</web-app>
Note: See TracChangeset for help on using the changeset viewer.