Changeset 23ca49ea


Ignore:
Timestamp:
Jan 14, 2012 6:04:39 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fd6fcda
Parents:
7df8814 (diff), edf5ef5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

propagate from branch 'i2p.i2p' (head b3d611a1fe034bc89963c54179d5bef3a3147950)

to branch 'i2p.i2p.zzz.jetty6' (head c83bf7bd62d0e07be0d965f062f01b01864be4d2)

Files:
25 added
14 deleted
81 edited
15 moved

Legend:

Unmodified
Added
Removed
  • LICENSE.txt

    r7df8814 r23ca49ea  
    173173   See licenses/LICENSE-GPLv2.txt
    174174
    175    Jetty 5.1.15:
    176    Copyright 2000-2004 Mort Bay Consulting Pty. Ltd.
     175   Jetty 6.1.26:
     176   Copyright 1995-2009 Mort Bay Consulting Pty Ltd
     177   See licenses/LICENSE-Jetty.txt
    177178   See licenses/LICENSE-Apache2.0.txt
    178179   See licenses/NOTICE-Commons-Logging.txt
     
    216217   GPLv2 (or any later version)
    217218   See licenses/LICENSE-GPLv2.txt
    218        Uses Apache Jakarta Standard Tag Library 1.1.2:
    219        See licenses/LICENSE-Apache2.0.txt
     219       Uses Glassfish Standard Tag Library (JSTL) 1.2:
     220       Common Development and Distribution License (CDDL) version 1.0 + GNU General Public License (GPL) version 2
     221       See https://glassfish.dev.java.net/public/CDDL+GPL.html
     222       See licenses/LICENSE-GPLv2.txt
    220223
    221224   SusiMail:
     
    229232      See licenses/LICENSE-LGPLv2.1.txt
    230233
     234   Tomcat 6.0.35:
     235   Copyright 1999-2011 The Apache Software Foundation
     236   See licenses/LICENSE-Apache2.0.txt
     237   See licenses/NOTICE-Tomcat.txt
    231238
    232239
  • apps/addressbook/java/src/net/i2p/addressbook/Servlet.java

    r7df8814 r23ca49ea  
    8585        this.thread.setName("Addressbook");
    8686        this.thread.start();
    87         System.out.println("INFO: Starting Addressbook " + Daemon.VERSION);
     87        //System.out.println("INFO: Starting Addressbook " + Daemon.VERSION);
    8888        //System.out.println("INFO: config root under " + args[0]);
    8989    }
  • apps/i2psnark/java/build.xml

    r7df8814 r23ca49ea  
    2020                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
    2121                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     22                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
    2223            </classpath>
    2324        </depend>
     
    3536            destdir="./build/obj"
    3637            includeAntRuntime="false"
    37             classpath="../../../core/java/build/i2p.jar:../../jetty/jettylib/org.mortbay.jetty.jar:../../jetty/jettylib/javax.servlet.jar:../../ministreaming/java/build/mstreaming.jar" >
     38            classpath="../../../core/java/build/i2p.jar:../../jetty/jettylib/org.mortbay.jetty.jar:../../jetty/jettylib/javax.servlet.jar:../../jetty/jettylib/jetty-util.jar:../../ministreaming/java/build/mstreaming.jar" >
    3839            <compilerarg line="${javac.compilerargs}" />
    3940        </javac>
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r7df8814 r23ca49ea  
    4444import org.klomp.snark.TrackerClient;
    4545
    46 import org.mortbay.http.HttpResponse;
    47 import org.mortbay.jetty.servlet.Default;
    48 import org.mortbay.util.Resource;
    49 import org.mortbay.util.URI;
     46import org.mortbay.jetty.servlet.DefaultServlet;
     47import org.mortbay.resource.Resource;
     48import org.mortbay.util.URIUtil;
    5049
    5150/**
     
    5453 *  often-blocked-by-the-browser file://
    5554 */
    56 public class I2PSnarkServlet extends Default {
     55public class I2PSnarkServlet extends DefaultServlet {
    5756    private I2PAppContext _context;
    5857    private Log _log;
     
    10099     */
    101100    @Override
    102     protected Resource getResource(String pathInContext) throws IOException
     101    public Resource getResource(String pathInContext)
    103102    {
    104103        if (pathInContext == null || pathInContext.equals("/") || pathInContext.equals("/index.jsp") ||
     
    106105            return super.getResource(pathInContext);
    107106        // files in the i2psnark/ directory
    108         return _resourceBase.addPath(pathInContext);
     107        try {
     108            return _resourceBase.addPath(pathInContext);
     109        } catch (IOException ioe) {
     110            throw new RuntimeException(ioe);
     111        }
    109112    }
    110113
     
    114117     */
    115118    @Override
    116     public void handleGet(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource, boolean endsWithSlash) throws ServletException, IOException {
    117         if (resource.getName().startsWith("jar:file:"))
    118             response.setHeader("Cache-Control", "max-age=86400");  // cache for a day
    119         super.handleGet(request, response, pathInContext, resource, endsWithSlash);
     119    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     120////////////////////////////////////
     121        //if (resource.getName().startsWith("jar:file:"))
     122        //    response.setHeader("Cache-Control", "max-age=86400");  // cache for a day
     123        super.doGet(request, response);
    120124    }
    121125
     
    145149        String method = req.getMethod();
    146150        if (!(method.equals("GET") || method.equals("HEAD") || method.equals("POST"))) {
    147             resp.sendError(HttpResponse.__405_Method_Not_Allowed);
     151            resp.sendError(405);
    148152            return;
    149153        }
     
    158162                // bypass the horrid Resource.getListHTML()
    159163                String pathInfo = req.getPathInfo();
    160                 String pathInContext = URI.addPaths(path, pathInfo);
     164                String pathInContext = URIUtil.addPaths(path, pathInfo);
    161165                req.setCharacterEncoding("UTF-8");
    162166                resp.setCharacterEncoding("UTF-8");
     
    164168                Resource resource = getResource(pathInContext);
    165169                if (resource == null || (!resource.exists())) {
    166                     resp.sendError(HttpResponse.__404_Not_Found);
     170                    resp.sendError(404);
    167171                } else {
    168                     String base = URI.addPaths(req.getRequestURI(), "/");
     172                    String base = URIUtil.addPaths(req.getRequestURI(), "/");
    169173                    String listing = getListHTML(resource, base, true, method.equals("POST") ? req.getParameterMap() : null);
    170174                    if (listing != null)
    171175                        resp.getWriter().write(listing);
    172176                    else // shouldn't happen
    173                         resp.sendError(HttpResponse.__404_Not_Found);
     177                        resp.sendError(404);
    174178                }
    175179            } else {
     
    16811685        StringBuilder buf=new StringBuilder(4096);
    16821686        buf.append(DOCTYPE + "<HTML><HEAD><TITLE>");
    1683         String title = URI.decodePath(base);
     1687        String title = URIUtil.decodePath(base);
    16841688        if (title.startsWith("/i2psnark/"))
    16851689            title = title.substring("/i2psnark/".length());
     
    17841788        buf.append("</tr></thead>\n");
    17851789        buf.append("<tr><td colspan=\"" + (showPriority ? '4' : '3') + "\" class=\"ParentDir\"><A HREF=\"");
    1786         buf.append(URI.addPaths(base,"../"));
     1790        buf.append(URIUtil.addPaths(base,"../"));
    17871791        buf.append("\"><img alt=\"\" border=\"0\" src=\"" + _imgPath + "up.png\"> ")
    17881792            .append(_("Up to higher level directory")).append("</A></td></tr>\n");
     
    17941798        for (int i=0 ; i< ls.length ; i++)
    17951799        {   
    1796             String encoded=URI.encodePath(ls[i]);
     1800            String encoded=URIUtil.encodePath(ls[i]);
    17971801            // bugfix for I2P - Backport from Jetty 6 (zero file lengths and last-modified times)
    17981802            // http://jira.codehaus.org/browse/JETTY-361?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel#issue-tabs
     
    18501854            }
    18511855
    1852             String path=URI.addPaths(base,encoded);
     1856            String path=URIUtil.addPaths(base,encoded);
    18531857            if (item.isDirectory() && !path.endsWith("/"))
    1854                 path=URI.addPaths(path,"/");
     1858                path=URIUtil.addPaths(path,"/");
    18551859            String icon = toIcon(item);
    18561860
  • apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java

    r7df8814 r23ca49ea  
    3232            System.err.println("ERROR: Unable to create Jetty temporary work directory");
    3333       
     34        throw new RuntimeException("unsupported");
     35/****
    3436        try {
    3537            _server = new Server("jetty-i2psnark.xml");
     
    4042            e.printStackTrace();
    4143        }
     44****/
    4245    }
    4346   
    4447    public void stop() {
     48        throw new RuntimeException("unsupported");
     49/****
    4550        try {
    4651            _server.stop();
     
    4853            ie.printStackTrace();
    4954        }
     55****/
    5056    }
    5157}
  • apps/i2ptunnel/java/build.xml

    r7df8814 r23ca49ea  
    5353
    5454
    55     <!-- TODO: Move the web classes from the jar to the war - they are not part of the API
    56       -  This will require sponge to rewrite some seedless stuff that uses it.
    57      -->
     55    <!-- The web classes are now in the war not the jar - they are not part of the API -->
    5856    <target name="jar" depends="builddep, compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
    5957        <!-- set if unset -->
    6058        <property name="workspace.changes.j.tr" value="" />
    61         <jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class">
     59        <jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/EditBean.class **/IndexBean.class" >
    6260            <manifest>
    6361                <attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
     
    6866            </manifest>
    6967        </jar>
     68        <jar destfile="./build/temp-beans.jar" basedir="./build/obj" includes="**/EditBean.class **/IndexBean.class" />
    7069    </target>
    7170
     
    129128    </target>
    130129
     130    <!-- The web classes are now in the war not the jar - they are not part of the API -->
    131131    <target name="war" depends="precompilejsp, bundle, warUpToDate, listChangedFiles2" unless="war.uptodate" >
    132132        <!-- set if unset -->
    133133        <property name="workspace.changes.w.tr" value="" />
     134        <copy file="build/obj/net/i2p/i2ptunnel/web/EditBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
     135        <copy file="build/obj/net/i2p/i2ptunnel/web/IndexBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
    134136        <war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
    135137             basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
     
    170172                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    171173                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     174                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    172175                <pathelement location="../../jetty/jettylib/ant.jar" />
    173176                <pathelement location="build/i2ptunnel.jar" />
     177                <pathelement location="build/temp-beans.jar" />
    174178            </classpath>
    175179            <arg value="-d" />
    176180            <arg value="../jsp/WEB-INF/classes" />
     181            <arg value="-v" />
    177182            <arg value="-p" />
    178183            <arg value="net.i2p.i2ptunnel.jsp" />
     
    191196                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    192197                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     198                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    193199                <pathelement location="build/i2ptunnel.jar" />
     200                <pathelement location="build/temp-beans.jar" />
    194201            </classpath>
    195202        </javac>
  • apps/i2ptunnel/jsp/edit.jsp

    r7df8814 r23ca49ea  
    33
    44%><%@page pageEncoding="UTF-8"
     5%><%@page trimDirectiveWhitespaces="true"
    56%><%@page contentType="text/html" import="net.i2p.i2ptunnel.web.EditBean"
    67%><%
  • apps/i2ptunnel/jsp/editClient.jsp

    r7df8814 r23ca49ea  
    1 <%@page contentType="text/html" import="net.i2p.i2ptunnel.web.EditBean"%><?xml version="1.0" encoding="UTF-8"?>
     1<%@page contentType="text/html" import="net.i2p.i2ptunnel.web.EditBean"
     2%><%@page trimDirectiveWhitespaces="true"
     3%><?xml version="1.0" encoding="UTF-8"?>
    24<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    35<jsp:useBean class="net.i2p.i2ptunnel.web.EditBean" id="editBean" scope="request" />
  • apps/i2ptunnel/jsp/editServer.jsp

    r7df8814 r23ca49ea  
    1 <%@page contentType="text/html" import="net.i2p.i2ptunnel.web.EditBean"%><?xml version="1.0" encoding="UTF-8"?>
     1<%@page contentType="text/html" import="net.i2p.i2ptunnel.web.EditBean"
     2%><%@page trimDirectiveWhitespaces="true"
     3%><?xml version="1.0" encoding="UTF-8"?>
    24<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    35<jsp:useBean class="net.i2p.i2ptunnel.web.EditBean" id="editBean" scope="request" />
  • apps/i2ptunnel/jsp/index.jsp

    r7df8814 r23ca49ea  
    77
    88%><%@page pageEncoding="UTF-8"
     9%><%@page trimDirectiveWhitespaces="true"
    910%><%@page contentType="text/html" import="net.i2p.i2ptunnel.web.IndexBean"
    1011%><?xml version="1.0" encoding="UTF-8"?>
  • apps/jetty/build.xml

    r7df8814 r23ca49ea  
    22<project basedir="." default="all" name="jetty">
    33
    4     <property name="jetty.base" value="jetty-5.1.15" />
    5     <property name="jetty.sha1" value="3a7a3de50f86f0cdb23c33aec632ea7f44132c5e" />
    6     <property name="jetty.filename" value="${jetty.base}.tgz" />
    7     <property name="jetty.url" value="http://dist.codehaus.org/jetty/jetty-5.1.x/${jetty.filename}" />
     4    <property name="jetty.ver" value="6.1.26" />
     5    <property name="jetty.base" value="jetty-${jetty.ver}" />
     6    <property name="jetty.sha1" value="9485913f1a1945a849a90f1a34853d22350bc524" />
     7    <property name="jetty.filename" value="${jetty.base}.zip" />
     8    <property name="jetty.url" value="http://dist.codehaus.org/jetty/${jetty.base}/${jetty.filename}" />
    89    <property name="verified.filename" value="verified.txt" />
    910    <property name="javac.compilerargs" value="" />
     11    <property name="tomcat.lib" value="apache-tomcat-deployer/lib" />
    1012
    1113    <target name="all" depends="build" />
     
    6567
    6668    <target name="extractJettylib" unless="jetty.zip.extracted" >
     69      <!-- for .tgz -->
     70      <!--
    6771        <gunzip src="${jetty.filename}" dest="jetty.tar" />
    6872        <untar src="jetty.tar" dest="." />
     73      -->
     74      <!-- for .zip -->
     75        <unzip src="${jetty.filename}" dest="." />
    6976        <mkdir dir="jettylib" />
    70         <copy todir="jettylib" preservelastmodified="true" >
    71             <fileset dir="${jetty.base}/lib">
    72                 <include name="*.jar" />
    73             </fileset>
    74             <fileset dir="${jetty.base}/ext">
    75                 <include name="ant.jar" />
    76                 <include name="commons-el.jar" />
    77                 <include name="commons-logging.jar" />
    78                 <include name="jasper-compiler.jar" />
    79                 <include name="jasper-runtime.jar" />
    80             </fileset>
    81         </copy>
     77      <!-- We copy everything to names without the version numbers so we
     78           can update them later. Where there was something similar in Jetty 5,
     79           we use the same names so they will overwrite the Jetty 5 jar on upgrade.
     80           Otherwise we use the same name as the symlink in Ubuntu /usr/share/java.
     81           Reasons for inclusion:
     82              start.jar: Needed for clients.config startup of eepsites
     83              jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
     84              jetty-sslengine-xxx.jar: SSL NIO Connector for console
     85              jetty-java5-threadpool-xxx.jar: Concurrent thread pool for eepsite
     86              glassfish 2.1: Not used, too old, see Tomcat below.
     87              jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
     88              All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
     89        -->
     90        <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
     91        <copy file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
     92        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
     93        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" />
     94        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
     95        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" />
     96        <copy file="${jetty.base}/lib/jsp-2.1/ant-1.6.5.jar" tofile="jettylib/ant.jar" />
    8297        <delete file="jetty.tar" />
    8398        <delete dir="${jetty.base}" />
     99        <!-- commons-logging.jar not in Jetty 6 but we have it in launch4j so copy it over, we need it
     100             for org.apache.jasper.JspC compiler
     101          -->
     102        <copy preservelastmodified="true" file="../../installer/lib/launch4j/lib/commons-logging.jar" todir="jettylib/" />
     103        <ant target="copyTomcatLib" />
     104    </target>
     105
     106    <!-- Tomcat.
     107         The glassfish jars bundled in Jetty 6 are way too old.
     108         For compatibility with very old I2P installations where the classpath
     109         was set individually in wrapper.config, we rename and combine the jars as follows:
     110         jasper.jar : jasper-runtime.jar
     111         jasper-el.jar + el-api.jar : commons-el.jar
     112         servlet-api.jar + jsp-api.jar : javax.servlet.jar
     113         tomcat-juli.jar : commons-logging.jar
     114         empty jar : jasper-compiler.jar
     115         Also, take NOTICE and LICENSE out of each one, we bundle those separately.
     116     -->
     117    <target name="copyTomcatLib" >
     118        <jar destfile="jettylib/jasper-runtime.jar" >
     119            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper.jar" />
     120        </jar>
     121        <jar destfile="jettylib/commons-el.jar" duplicate="preserve" >
     122            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper-el.jar" />
     123            <zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/el-api.jar" />
     124        </jar>
     125        <jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" >
     126            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/servlet-api.jar" />
     127            <zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/jsp-api.jar" />
     128        </jar>
     129        <jar destfile="jettylib/commons-logging.jar" >
     130            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-juli.jar" />
     131        </jar>
     132        <jar destfile="jettylib/jasper-compiler.jar" />
    84133    </target>
    85134
    86135    <target name="build" depends="jar" />
     136
    87137    <target name="builddep" />
    88138    <target name="compile" depends="builddep, ensureJettylib" >
     
    94144            destdir="./build/obj"
    95145            includeAntRuntime="false"
    96             classpath="./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar" >
     146            classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-util.jar" >
    97147            <compilerarg line="${javac.compilerargs}" />
    98148        </javac>
     
    113163    </target>
    114164
     165    <!-- With Jetty 5 we replaced classes in the jar, but with Jetty 6 we
     166         put our stuff in its own jar so we can work with standard Jetty 6 packages
     167      -->
    115168    <target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
    116169        <!-- set if unset -->
    117170        <property name="workspace.changes.tr" value="" />
    118         <jar destfile="./jettylib/org.mortbay.jetty.jar" basedir="./build/obj" includes="**/*.class" update="true" >
     171        <copy todir="build/obj" file="resources/log4j.properties" />
     172        <jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
    119173            <manifest>
    120174                <attribute name="Build-Date" value="${build.timestamp}" />
     
    126180
    127181    <target name="jarUpToDate">
    128         <uptodate property="jar.uptodate" targetfile="jettylib/org.mortbay.jetty.jar" >
     182        <uptodate property="jar.uptodate" targetfile="jettylib/jetty-i2p.jar" >
    129183            <srcfiles dir= "build/obj" includes="**/*.class" />
    130184        </uptodate>
  • apps/routerconsole/java/build.xml

    r7df8814 r23ca49ea  
    2222                <pathelement location="../../../router/java/build/obj" />
    2323                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     24                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     25                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     26                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
    2427                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     28                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     29                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    2530                <pathelement location="../../systray/java/build/obj" />
    2631                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    5459                <pathelement location="../../../router/java/build/router.jar" />
    5560                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     61                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     62                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     63                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
    5664                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     65                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     66                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    5767                <pathelement location="../../systray/java/build/systray.jar" />
    5868                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    234244                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    235245                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     246                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    236247                <pathelement location="../../jetty/jettylib/ant.jar" />
     248                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    237249                <pathelement location="../../systray/java/build/obj" />
    238250                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    267279                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    268280                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     281                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     282                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     283                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
     284                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     285                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    269286                <pathelement location="../../systray/java/build/obj" />
    270287                <pathelement location="../../systray/java/lib/systray4j.jar" />
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    r7df8814 r23ca49ea  
    1515import net.i2p.router.startup.LoadClientAppsJob;
    1616
    17 import org.mortbay.jetty.Server;
     17import org.mortbay.jetty.handler.ContextHandlerCollection;
    1818
    1919/**
     
    287287     */
    288288    private void startWebApp(String app) {
    289         Server s = WebAppStarter.getConsoleServer();
     289        ContextHandlerCollection s = WebAppStarter.getConsoleServer();
    290290        if (s != null) {
    291291                    try {
  • apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java

    r7df8814 r23ca49ea  
    55import java.util.Map;
    66
     7import javax.servlet.ServletException;
     8import javax.servlet.http.HttpServletRequest;
     9import javax.servlet.http.HttpServletResponse;
     10
    711import net.i2p.I2PAppContext;
    812
    9 import org.mortbay.http.HttpRequest;
    10 import org.mortbay.http.HttpResponse;
    11 import org.mortbay.jetty.servlet.WebApplicationHandler;
     13import org.mortbay.jetty.webapp.WebAppContext;
    1214
    1315/**
     
    2022 * @author zzz
    2123 */
    22 public class LocaleWebAppHandler extends WebApplicationHandler
     24public class LocaleWebAppHandler extends WebAppContext
    2325{
    2426    private final I2PAppContext _context;
    2527
    26     public LocaleWebAppHandler(I2PAppContext ctx) {
    27         super();
     28    public LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath) {
     29        super(warPath, path);
    2830        _context = ctx;
    2931    }
     
    3739    @Override
    3840    public void handle(String pathInContext,
    39                        String pathParams,
    40                        HttpRequest httpRequest,
    41                        HttpResponse httpResponse)
    42          throws IOException
     41                       HttpServletRequest httpRequest,
     42                       HttpServletResponse httpResponse,
     43                       int dispatch)
     44         throws IOException, ServletException
    4345    {
    4446        // Handle OPTIONS (nothing to override)
    45         if (HttpRequest.__OPTIONS.equals(httpRequest.getMethod()))
     47        if ("OPTIONS".equals(httpRequest.getMethod()))
    4648        {
    4749            handleOptions(httpRequest, httpResponse);
     
    7577                    String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp";
    7678                    // Do we have a servlet for the new path that isn't the catchall *.jsp?
    77                     Map.Entry servlet = getHolderEntry(testPath);
     79                    Map.Entry servlet = getServletHandler().getHolderEntry(testPath);
    7880                    if (servlet != null) {
    7981                        String servletPath = (String) servlet.getKey();
     
    8890        }
    8991        //System.err.println("New path: " + newPath);
    90         super.handle(newPath, pathParams, httpRequest, httpResponse);
     92        super.handle(newPath, httpRequest, httpResponse, dispatch);
    9193        //System.err.println("Was handled? " + httpRequest.isHandled());
    9294    }
     
    9698     *  @since 0.8
    9799     */
     100/****  not in Jetty 6
    98101    @Override
    99     public void handleTrace(HttpRequest request,
    100                             HttpResponse response)
     102    public void handleTrace(HttpServletRequest request,
     103                            HttpServletResponse response)
    101104        throws IOException
    102105    {
    103         response.sendError(HttpResponse.__405_Method_Not_Allowed);
     106        response.sendError(405);
    104107    }
     108****/
    105109
    106110    /**
     
    108112     *  @since 0.8
    109113     */
    110     public void handleOptions(HttpRequest request,
    111                               HttpResponse response)
     114    public void handleOptions(HttpServletRequest request,
     115                              HttpServletResponse response)
    112116        throws IOException
    113117    {
    114         response.sendError(HttpResponse.__405_Method_Not_Allowed);
     118        response.sendError(405);
    115119    }
    116120}
  • apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java

    r7df8814 r23ca49ea  
    77import net.i2p.util.VersionComparator;
    88
     9import org.mortbay.jetty.Server;
    910import org.mortbay.http.Version;
    1011import org.tanukisoftware.wrapper.WrapperManager;
     
    1617    /** @since 0.8.12 */
    1718    public String getJettyVersion() {
    18         return jettyVersion();
     19        return Server.getVersion();
    1920    }
    20    
     21
    2122    /** @since 0.8.13 */
    2223    static String jettyVersion() {
    23         try {
    24             String rv = Version.getImplVersion();
    25             if (rv.startsWith("Jetty/"))
    26                 rv = rv.substring(6);
    27             return rv;
    28         } catch (Throwable t) {
    29             return "unknown";
    30         }
     24        return Server.getVersion();
    3125    }
    3226
  • apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java

    r7df8814 r23ca49ea  
    3131import net.i2p.util.VersionComparator;
    3232
    33 import org.mortbay.jetty.Server;
     33import org.mortbay.jetty.handler.ContextHandlerCollection;
    3434
    3535
     
    158158
    159159        // start console webapps in console/webapps
    160         Server server = WebAppStarter.getConsoleServer();
     160        ContextHandlerCollection server = WebAppStarter.getConsoleServer();
    161161        if (server != null) {
    162162            File consoleDir = new File(pluginDir, "console");
     
    258258
    259259        // stop console webapps in console/webapps
    260         Server server = WebAppStarter.getConsoleServer();
    261         if (server != null) {
     260        //ContextHandlerCollection server = WebAppStarter.getConsoleServer();
     261        //if (server != null) {
    262262        /*
    263263            File consoleDir = new File(pluginDir, "console");
     
    279279                while (wars.hasNext()) {
    280280                    String warName = wars.next();
    281                     WebAppStarter.stopWebApp(server, warName);
     281                    WebAppStarter.stopWebApp(warName);
    282282                }
    283283                pluginWars.get(appName).clear();
    284284            }
    285         }
     285        //}
    286286
    287287        // remove summary bar link
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    r7df8814 r23ca49ea  
    1010import java.util.Properties;
    1111import java.util.StringTokenizer;
     12import java.util.concurrent.Executors;
     13import java.util.concurrent.SynchronousQueue;
     14import java.util.concurrent.TimeUnit;
     15import java.util.concurrent.ThreadFactory;
     16import java.util.concurrent.ThreadPoolExecutor;
    1217
    1318import net.i2p.I2PAppContext;
     
    1621import net.i2p.data.DataHelper;
    1722import net.i2p.desktopgui.Main;
     23import net.i2p.jetty.I2PLogger;
    1824import net.i2p.router.RouterContext;
    1925import net.i2p.util.FileUtil;
     
    2531import net.i2p.util.VersionComparator;
    2632
    27 import org.mortbay.http.DigestAuthenticator;
    28 import org.mortbay.http.HashUserRealm;
    29 import org.mortbay.http.NCSARequestLog;
    30 import org.mortbay.http.SecurityConstraint;
    31 import org.mortbay.http.SocketListener;
    32 import org.mortbay.http.SslListener;
    33 import org.mortbay.http.handler.SecurityHandler;
     33import org.mortbay.jetty.AbstractConnector;
     34import org.mortbay.jetty.Connector;
     35import org.mortbay.jetty.Handler;
     36import org.mortbay.jetty.NCSARequestLog;
    3437import org.mortbay.jetty.Server;
    35 import org.mortbay.jetty.servlet.WebApplicationContext;
    36 import org.mortbay.jetty.servlet.WebApplicationHandler;
    37 import org.mortbay.util.InetAddrPort;
    38 
     38import org.mortbay.jetty.handler.ContextHandlerCollection;
     39import org.mortbay.jetty.handler.DefaultHandler;
     40import org.mortbay.jetty.handler.HandlerCollection;
     41import org.mortbay.jetty.handler.RequestLogHandler;
     42import org.mortbay.jetty.nio.SelectChannelConnector;
     43import org.mortbay.jetty.security.DigestAuthenticator;
     44import org.mortbay.jetty.security.HashUserRealm;
     45import org.mortbay.jetty.security.Constraint;
     46import org.mortbay.jetty.security.ConstraintMapping;
     47import org.mortbay.jetty.security.SecurityHandler;
     48import org.mortbay.jetty.security.SslSelectChannelConnector;
     49import org.mortbay.jetty.servlet.ServletHandler;
     50import org.mortbay.jetty.servlet.ServletHolder;
     51import org.mortbay.jetty.servlet.SessionHandler;
     52import org.mortbay.jetty.webapp.WebAppContext;
     53import org.mortbay.log.Log;
     54import org.mortbay.thread.QueuedThreadPool;
     55import org.mortbay.thread.concurrent.ThreadPool;
     56
     57/**
     58 *  Start the router console.
     59 */
    3960public class RouterConsoleRunner {
    40     private Server _server;
     61    private static Server _server;
    4162    private String _listenPort;
    4263    private String _listenHost;
     
    4465    private String _sslListenHost;
    4566    private String _webAppsDir;
     67
    4668    private static final String PROP_WEBAPP_CONFIG_FILENAME = "router.webappsConfigFile";
    4769    private static final String DEFAULT_WEBAPP_CONFIG_FILENAME = "webapps.config";
     
    5880    private static final String USAGE = "Bad RouterConsoleRunner arguments, check clientApp.0.args in your clients.config file! " +
    5981                                        "Usage: [[port host[,host]] [-s sslPort [host[,host]]] [webAppsDir]]";
     82
     83    private static final int MIN_THREADS = 1;
     84    private static final int MAX_THREADS = 24;
     85    private static final int MAX_IDLE_TIME = 90*1000;
     86    private static final String THREAD_NAME = "RouterConsole Jetty";
    6087   
    6188    static {
     
    136163    }
    137164   
     165    /**
     166     *  SInce _server is now static
     167     *  @return may be null or stopped perhaps
     168     *  @since Jetty 6 since it doesn't have Server.getServers()
     169     */
     170    static Server getConsoleServer() {
     171        return _server;
     172    }
     173
    138174    private static void startTrayApp() {
    139175        try {
     
    159195    }
    160196
     197    /**
     198     *  http://irc.codehaus.org/display/JETTY/Porting+to+jetty6
     199     *
     200     *<pre>
     201     *  Server
     202     *          HandlerCollection
     203     *                  ContextHandlerCollection
     204     *                          WebAppContext (i.e. ContextHandler)
     205     *                                  SessionHandler
     206     *                                  SecurityHandler
     207     *                                  ServletHandler
     208     *                                          servlets...
     209     *                          WebAppContext
     210     *                          ...
     211     *                  DefaultHandler
     212     *                  RequestLogHandler (opt)
     213     *</pre>
     214     */
    161215    public void startConsole() {
    162216        File workDir = new SecureDirectory(I2PAppContext.getGlobalContext().getTempDir(), "jetty-work");
     
    168222            System.err.println("ERROR: Unable to create Jetty temporary work directory");
    169223       
     224        //try {
     225        //    Log.setLog(new I2PLogger(I2PAppContext.getGlobalContext()));
     226        //} catch (Throwable t) {
     227        //    System.err.println("INFO: I2P Jetty logging class not found, logging to wrapper log");
     228        //}
     229        // This way it doesn't try to load Slf4jLog first
     230        System.setProperty("org.mortbay.log.class", "net.i2p.jetty.I2PLogger");
     231
    170232        // so Jetty can find WebAppConfiguration
    171233        System.setProperty("jetty.class.path", I2PAppContext.getGlobalContext().getBaseDir() + "/lib/routerconsole.jar");
    172234        _server = new Server();
     235        _server.setGracefulShutdown(1000);
     236
     237        try {
     238            ThreadPool ctp = new CustomThreadPoolExecutor();
     239            ctp.prestartAllCoreThreads();
     240            _server.setThreadPool(ctp);
     241        } catch (Throwable t) {
     242            // class not found...
     243            System.out.println("INFO: Jetty concurrent ThreadPool unavailable, using QueuedThreadPool");
     244            QueuedThreadPool qtp = new QueuedThreadPool(MAX_THREADS);
     245            qtp.setMinThreads(MIN_THREADS);
     246            qtp.setMaxIdleTimeMs(MAX_IDLE_TIME);
     247            _server.setThreadPool(qtp);
     248        }
     249
     250        HandlerCollection hColl = new HandlerCollection();
     251        ContextHandlerCollection chColl = new ContextHandlerCollection();
     252        _server.addHandler(hColl);
     253        hColl.addHandler(chColl);
     254        hColl.addHandler(new DefaultHandler());
    173255
    174256        String log = I2PAppContext.getGlobalContext().getProperty("routerconsole.log");
     
    178260                logFile = new File(I2PAppContext.getGlobalContext().getLogDir(), "logs/" + log);
    179261            try {
    180                 _server.setRequestLog(new NCSARequestLog(logFile.getAbsolutePath()));
    181             } catch (IOException ioe) {
     262                RequestLogHandler rhl = new RequestLogHandler();
     263                rhl.setRequestLog(new NCSARequestLog(logFile.getAbsolutePath()));
     264                hColl.addHandler(rhl);
     265            } catch (Exception ioe) {
    182266                System.err.println("ERROR: Unable to create Jetty log: " + ioe);
    183267            }
     
    202286            _webAppsDir += '/';
    203287
    204         List<String> notStarted = new ArrayList();
    205         WebApplicationHandler baseHandler = null;
     288        WebAppContext rootWebApp = null;
     289        ServletHandler rootServletHandler = null;
    206290        try {
    207291            int boundAddresses = 0;
     
    218302                        //else
    219303                        //    _server.addListener(host + ':' + _listenPort);
    220                         InetAddrPort iap = new InetAddrPort(host, lport);
    221                         SocketListener lsnr = new SocketListener(iap);
    222                         lsnr.setMinThreads(1);           // default 2
    223                         lsnr.setMaxThreads(24);          // default 256
    224                         lsnr.setMaxIdleTimeMs(90*1000);  // default 10 sec
     304                        // Use AbstractConnector instead of Connector so we can do setName()
     305                        AbstractConnector lsnr = new SelectChannelConnector();
     306                        lsnr.setHost(host);
     307                        lsnr.setPort(lport);
     308                        lsnr.setMaxIdleTime(90*1000);  // default 10 sec
    225309                        lsnr.setName("ConsoleSocket");   // all with same name will use the same thread pool
    226                         _server.addListener(lsnr);
     310                        _server.addConnector(lsnr);
    227311                        boundAddresses++;
    228312                    } catch (NumberFormatException nfe) {
    229313                        System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ' ' + nfe);
    230                     } catch (IOException ioe) { // this doesn't seem to work, exceptions don't happen until start() below
     314                    } catch (Exception ioe) { // this doesn't seem to work, exceptions don't happen until start() below
    231315                        System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ' ' + ioe);
    232316                    }
     
    253337                        String host = tok.nextToken().trim();
    254338                        // doing it this way means we don't have to escape an IPv6 host with []
    255                         InetAddrPort iap = new InetAddrPort(host, sslPort);
    256339                        try {
    257                             SslListener ssll = new SslListener(iap);
     340                            // TODO if class not found use SslChannelConnector
     341                            // Sadly there's no common base class with the ssl methods in it
     342                            SslSelectChannelConnector ssll = new SslSelectChannelConnector();
     343                            ssll.setHost(host);
     344                            ssll.setPort(sslPort);
    258345                            // the keystore path and password
    259346                            ssll.setKeystore(keyStore.getAbsolutePath());
     
    261348                            // the X.509 cert password (if not present, verifyKeyStore() returned false)
    262349                            ssll.setKeyPassword(ctx.getProperty(PROP_KEY_PASSWORD, "thisWontWork"));
    263                             ssll.setMinThreads(1);           // default 2
    264                             ssll.setMaxThreads(24);          // default 256
    265                             ssll.setMaxIdleTimeMs(90*1000);  // default 10 sec
     350                            ssll.setMaxIdleTime(90*1000);  // default 10 sec
    266351                            ssll.setName("ConsoleSocket");   // all with same name will use the same thread pool
    267                             _server.addListener(ssll);
     352                            _server.addConnector(ssll);
    268353                            boundAddresses++;
    269354                        } catch (Exception e) {   // probably no exceptions at this point
     
    281366                return;
    282367            }
    283             _server.setRootWebApp(ROUTERCONSOLE);
    284             WebApplicationContext wac = _server.addWebApplication("/", _webAppsDir + ROUTERCONSOLE + ".war");
     368
     369            rootWebApp = new LocaleWebAppHandler(I2PAppContext.getGlobalContext(),
     370                                                  "/", _webAppsDir + ROUTERCONSOLE + ".war");
    285371            File tmpdir = new SecureDirectory(workDir, ROUTERCONSOLE + "-" +
    286372                                                       (_listenPort != null ? _listenPort : _sslListenPort));
    287373            tmpdir.mkdir();
    288             wac.setTempDirectory(tmpdir);
    289             baseHandler = new LocaleWebAppHandler(I2PAppContext.getGlobalContext());
    290             wac.addHandler(0, baseHandler);
    291             initialize(wac);
    292             File dir = new File(_webAppsDir);
    293             String fileNames[] = dir.list(WarFilenameFilter.instance());
    294             if (fileNames != null) {
    295                 for (int i = 0; i < fileNames.length; i++) {
    296                     try {
    297                         String appName = fileNames[i].substring(0, fileNames[i].lastIndexOf(".war"));
    298                         String enabled = props.getProperty(PREFIX + appName + ENABLED);
    299                         if (! "false".equals(enabled)) {
    300                             String path = new File(dir, fileNames[i]).getCanonicalPath();
    301                             tmpdir = new SecureDirectory(workDir, appName + "-" +
    302                                                                   (_listenPort != null ? _listenPort : _sslListenPort));
    303                             WebAppStarter.addWebApp(I2PAppContext.getGlobalContext(), _server, appName, path, tmpdir);
    304 
    305                             if (enabled == null) {
    306                                 // do this so configclients.jsp knows about all apps from reading the config
    307                                 props.setProperty(PREFIX + appName + ENABLED, "true");
    308                                 rewrite = true;
    309                             }
    310                         } else {
    311                             notStarted.add(appName);
    312                         }
    313                     } catch (IOException ioe) {
    314                         System.err.println("Error resolving '" + fileNames[i] + "' in '" + dir);
    315                     }
    316                 }
    317             }
    318         } catch (IOException ioe) {
     374            rootWebApp.setTempDirectory(tmpdir);
     375            rootWebApp.setSessionHandler(new SessionHandler());
     376            rootServletHandler = new ServletHandler();
     377            rootWebApp.setServletHandler(rootServletHandler);
     378            initialize(rootWebApp);
     379            chColl.addHandler(rootWebApp);
     380
     381        } catch (Exception ioe) {
    319382            ioe.printStackTrace();
    320383        }
    321         if (rewrite)
    322             storeWebAppProperties(props);
     384
    323385        try {
     386            // start does a mapContexts()
    324387            _server.start();
    325388        } catch (Throwable me) {
     
    334397        }
    335398
    336         if (baseHandler != null) {
     399        // Start all the other webapps after the server is up,
     400        // so things start faster.
     401        // Jetty 6 starts the connector before the router console is ready
     402        // This also prevents one webapp from breaking the whole thing
     403        List<String> notStarted = new ArrayList();
     404        if (_server.isRunning()) {
     405            File dir = new File(_webAppsDir);
     406            String fileNames[] = dir.list(WarFilenameFilter.instance());
     407            if (fileNames != null) {
     408                for (int i = 0; i < fileNames.length; i++) {
     409                    String appName = fileNames[i].substring(0, fileNames[i].lastIndexOf(".war"));
     410                    String enabled = props.getProperty(PREFIX + appName + ENABLED);
     411                    if (! "false".equals(enabled)) {
     412                        try {
     413                            String path = new File(dir, fileNames[i]).getCanonicalPath();
     414                            WebAppStarter.startWebApp(I2PAppContext.getGlobalContext(), chColl, appName, path);
     415                            if (enabled == null) {
     416                                // do this so configclients.jsp knows about all apps from reading the config
     417                                props.setProperty(PREFIX + appName + ENABLED, "true");
     418                                rewrite = true;
     419                            }
     420                        } catch (Throwable t) {
     421                            System.err.println("ERROR: Failed to start " + appName + ' ' + t);
     422                            t.printStackTrace();
     423                            notStarted.add(appName);
     424                        }
     425                    } else {
     426                        notStarted.add(appName);
     427                    }
     428                }
     429            }
     430        } else {
     431            System.err.println("ERROR: Router console did not start, not starting webapps");
     432        }
     433
     434        if (rewrite)
     435            storeWebAppProperties(props);
     436
     437        if (rootServletHandler != null && notStarted.size() > 0) {
    337438            // map each not-started webapp to the error page
     439            ServletHolder noWebApp = rootServletHandler.getServlet("net.i2p.router.web.jsp.nowebapp_jsp");
    338440            for (int i = 0; i < notStarted.size(); i++) {
     441                // we want a new handler for each one since if the webapp is started we remove the handler???
    339442                try {
    340                      baseHandler.mapPathToServlet('/' + notStarted.get(i) + "/*",
    341                                                   "net.i2p.router.web.jsp.nowebapp_jsp");
     443                    if (noWebApp != null) {
     444                        String path = '/' + notStarted.get(i);
     445                        // LocaleWebAppsHandler adds a .jsp
     446                        rootServletHandler.addServletWithMapping(noWebApp, path + ".jsp");
     447                        rootServletHandler.addServletWithMapping(noWebApp, path + "/*");
     448                    } else {
     449                        System.err.println("Can't find nowebapp.jsp?");
     450                    }
    342451                } catch (Throwable me) {
    343452                     System.err.println(me);
     453                     me.printStackTrace();
    344454                }
    345455            }
     
    456566    }
    457567
    458     static void initialize(WebApplicationContext context) {
     568    static void initialize(WebAppContext context) {
     569        SecurityHandler sec = new SecurityHandler();
     570        List<ConstraintMapping> constraints = new ArrayList(4);
    459571        String password = getPassword();
    460572        if (password != null) {
     
    462574            realm.put("admin", password);
    463575            realm.addUserToRole("admin", "routerAdmin");
    464             context.setRealm(realm);
    465             context.setAuthenticator(authenticator);
    466             context.addHandler(0, new SecurityHandler());
    467             SecurityConstraint constraint = new SecurityConstraint("admin", "routerAdmin");
     576            sec.setUserRealm(realm);
     577            sec.setAuthenticator(authenticator);
     578            Constraint constraint = new Constraint("admin", "routerAdmin");
    468579            constraint.setAuthenticate(true);
    469             context.addSecurityConstraint("/", constraint);
     580            ConstraintMapping cm = new ConstraintMapping();
     581            cm.setConstraint(constraint);
     582            cm.setPathSpec("/");
     583            constraints.add(cm);
    470584        }
    471585
     
    479593        // See also:
    480594        // http://old.nabble.com/Disable-HTTP-TRACE-in-Jetty-5.x-td12412607.html
    481         SecurityConstraint sc = new SecurityConstraint();
    482         sc.setName("No trace or options");
    483         sc.addMethod("TRACE");
    484         sc.addMethod("OPTIONS");
    485         sc.setAuthenticate(true);
    486         context.addSecurityConstraint("/*", sc) ;
     595
     596        Constraint sc = new Constraint();
     597        sc.setName("No trace");
     598        ConstraintMapping cm = new ConstraintMapping();
     599        cm.setMethod("TRACE");
     600        cm.setConstraint(sc);
     601        cm.setPathSpec("/");
     602        constraints.add(cm);
     603
     604        sc = new Constraint();
     605        sc.setName("No options");
     606        cm = new ConstraintMapping();
     607        cm.setMethod("OPTIONS");
     608        cm.setConstraint(sc);
     609        cm.setPathSpec("/");
     610        constraints.add(cm);
     611
     612        ConstraintMapping cmarr[] = constraints.toArray(new ConstraintMapping[constraints.size()]);
     613        sec.setConstraintMappings(cmarr);
     614
     615        context.setSecurityHandler(sec);
    487616    }
    488617   
     
    509638   
    510639    /** @since 0.8.8 */
    511     private class ServerShutdown implements Runnable {
     640    private static class ServerShutdown implements Runnable {
    512641        public void run() {
    513642            try {
    514643                _server.stop();
    515             } catch (InterruptedException ie) {}
     644            } catch (Exception ie) {}
    516645        }
    517646    }
     
    572701    }
    573702
     703   
     704    /**
     705     * Just to set the name and set Daemon
     706     * @since Jetty 6
     707     */
     708    private static class CustomThreadPoolExecutor extends ThreadPool {
     709        public CustomThreadPoolExecutor() {
     710             super(MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS,
     711                   new SynchronousQueue(), new CustomThreadFactory(),
     712                   new ThreadPoolExecutor.CallerRunsPolicy());
     713        }
     714    }
     715
     716    /**
     717     * Just to set the name and set Daemon
     718     * @since Jetty 6
     719     */
     720    private static class CustomThreadFactory implements ThreadFactory {
     721
     722        public Thread newThread(Runnable r) {
     723            Thread rv = Executors.defaultThreadFactory().newThread(r);
     724            rv.setName(THREAD_NAME);
     725            rv.setDaemon(true);
     726            return rv;
     727        }
     728    }
     729
    574730}
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java

    r7df8814 r23ca49ea  
    77import net.i2p.I2PAppContext;
    88
    9 import org.mortbay.jetty.servlet.WebApplicationContext;
     9import org.mortbay.jetty.webapp.Configuration;
     10import org.mortbay.jetty.webapp.WebAppContext;
    1011
    1112
     
    3233 *  @author zzz
    3334 */
    34 public class WebAppConfiguration implements WebApplicationContext.Configuration {
    35     private WebApplicationContext _wac;
     35public class WebAppConfiguration implements Configuration {
     36    private WebAppContext _wac;
    3637
    3738    private static final String CLASSPATH = ".classpath";
    3839
    39     public void setWebApplicationContext(WebApplicationContext context) {
     40    public void setWebAppContext(WebAppContext context) {
    4041       _wac = context;
    4142    }
    4243
    43     public WebApplicationContext getWebApplicationContext() {
     44    public WebAppContext getWebAppContext() {
    4445        return _wac;
    4546    }
     
    8889                path = dir.getAbsolutePath() + '/' + elem;
    8990            System.err.println("Adding " + path + " to classpath for " + appName);
    90             _wac.addClassPath(path);
     91            _wac.setExtraClasspath(path);
    9192        }
    9293    }
     
    9495    public void configureDefaults() {}
    9596    public void configureWebApp() {}
     97
     98    /** @since Jetty 6 */
     99    public void deconfigureWebApp() {}
     100
     101    /** @since Jetty 6 */
     102    public void configureClassLoader() {}
    96103}
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java

    r7df8814 r23ca49ea  
    1515import net.i2p.util.PortMapper;
    1616
    17 import org.mortbay.http.HttpContext;
    18 import org.mortbay.http.HttpListener;
     17import org.mortbay.jetty.Connector;
     18import org.mortbay.jetty.Handler;
    1919import org.mortbay.jetty.Server;
    20 import org.mortbay.jetty.servlet.WebApplicationContext;
     20import org.mortbay.jetty.webapp.WebAppContext;
     21import org.mortbay.jetty.handler.ContextHandler;
     22import org.mortbay.jetty.handler.ContextHandlerCollection;
    2123
    2224
     
    5052     *  @throws just about anything, caller would be wise to catch Throwable
    5153     */
    52     static void startWebApp(I2PAppContext ctx, Server server, String appName, String warPath) throws Exception {
     54    static void startWebApp(I2PAppContext ctx, ContextHandlerCollection server,
     55                            String appName, String warPath) throws Exception {
    5356         File tmpdir = new SecureDirectory(ctx.getTempDir(), "jetty-work-" + appName + ctx.random().nextInt());
    54          WebApplicationContext wac = addWebApp(ctx, server, appName, warPath, tmpdir);     
     57         WebAppContext wac = addWebApp(ctx, server, appName, warPath, tmpdir);     
    5558                 _log.debug("Loading war from: " + warPath);
    5659         wac.start();
     
    6265     *  and then starts all at once.
    6366     */
    64     static WebApplicationContext addWebApp(I2PAppContext ctx, Server server, String appName, String warPath, File tmpdir) throws IOException {
     67    static WebAppContext addWebApp(I2PAppContext ctx, ContextHandlerCollection server,
     68                                   String appName, String warPath, File tmpdir) throws IOException {
    6569
    6670        // Jetty will happily load one context on top of another without stopping
    6771        // the first one, so we remove any previous one here
    6872        try {
    69             stopWebApp(server, appName);
     73            stopWebApp(appName);
    7074        } catch (Throwable t) {}
    7175
     
    9296        }
    9397
    94         WebApplicationContext wac = server.addWebApplication("/"+ appName, warPath);
     98        WebAppContext wac = new WebAppContext(warPath, "/"+ appName);
    9599        tmpdir.mkdir();
    96100        wac.setTempDirectory(tmpdir);
     
    102106
    103107        // see WebAppConfiguration for info
    104         String[] classNames = server.getWebApplicationConfigurationClassNames();
     108        String[] classNames = wac.getConfigurationClasses();
    105109        String[] newClassNames = new String[classNames.length + 1];
    106110        for (int j = 0; j < classNames.length; j++)
    107111             newClassNames[j] = classNames[j];
    108112        newClassNames[classNames.length] = WebAppConfiguration.class.getName();
    109         wac.setConfigurationClassNames(newClassNames);
     113        wac.setConfigurationClasses(newClassNames);
     114        server.addHandler(wac);
     115        server.mapContexts();
    110116        return wac;
    111117    }
     
    115121     *  @throws just about anything, caller would be wise to catch Throwable
    116122     */
    117     static void stopWebApp(Server server, String appName) {
    118         // this will return a new context if one does not exist
    119         HttpContext wac = server.getContext('/' + appName);
     123    static void stopWebApp(String appName) {
     124        ContextHandler wac = getWebApp(appName);
     125        if (wac == null)
     126            return;
    120127        try {
    121             // false -> not graceful
    122             wac.stop(false);
    123         } catch (InterruptedException ie) {}
     128            // not graceful is default in Jetty 6?
     129            wac.stop();
     130        } catch (Exception ie) {}
     131        ContextHandlerCollection server = getConsoleServer();
     132        if (server == null)
     133            return;
    124134        try {
    125             server.removeContext(wac);
     135            server.removeHandler(wac);
     136            server.mapContexts();
    126137        } catch (IllegalStateException ise) {}
    127138    }
    128139
    129140    static boolean isWebAppRunning(String appName) {
    130         Server server = WebAppStarter.getConsoleServer();
    131         if (server == null)
     141        ContextHandler wac = getWebApp(appName);
     142        if (wac == null)
    132143            return false;
    133         // this will return a new context if one does not exist
    134         HttpContext wac = server.getContext('/' + appName);
    135144        return wac.isStarted();
    136145    }
    137146   
    138     /** see comments in ConfigClientsHandler */
    139     static Server getConsoleServer() {
    140         PortMapper pm = I2PAppContext.getGlobalContext().portMapper();
    141         int p1 = pm.getPort(PortMapper.SVC_CONSOLE);
    142         int p2 = pm.getPort(PortMapper.SVC_HTTPS_CONSOLE);
    143         Collection c = Server.getHttpServers();
    144         for (int i = 0; i < c.size(); i++) {
    145             Server s = (Server) c.toArray()[i];
    146             HttpListener[] hl = s.getListeners();
    147             for (int j = 0; j < hl.length; j++) {
    148                 int port = hl[j].getPort();
    149                 if (port == p1 || port == p2)
    150                     return s;
    151             }
     147    /** @since Jetty 6 */
     148    static ContextHandler getWebApp(String appName) {
     149        ContextHandlerCollection server = getConsoleServer();
     150        if (server == null)
     151            return null;
     152        Handler handlers[] = server.getHandlers();
     153        if (handlers == null)
     154            return null;
     155        String path = '/'+ appName;
     156        for (int i = 0; i < handlers.length; i++) {
     157            ContextHandler ch = (ContextHandler) handlers[i];
     158            if (path.equals(ch.getContextPath()))
     159                return ch;
    152160        }
    153161        return null;
    154162    }
     163
     164    /** see comments in ConfigClientsHandler */
     165    static ContextHandlerCollection getConsoleServer() {
     166        Server s = RouterConsoleRunner.getConsoleServer();
     167        if (s == null)
     168            return null;
     169        Handler h = s.getChildHandlerByClass(ContextHandlerCollection.class);
     170        if (h == null)
     171            return null;
     172        return (ContextHandlerCollection) h;
     173    }
    155174}
  • apps/routerconsole/jsp/config.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html" %>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112
    1213<jsp:useBean class="net.i2p.router.web.ConfigNetHelper" id="nethelper" scope="request" />
    13 <jsp:setProperty name="nethelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14<jsp:setProperty name="nethelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415<h1><%=intl._("I2P Bandwidth Configuration")%></h1>
    1516<div class="main" id="main">
     
    1920 <% formhandler.storeMethod(request.getMethod()); %>
    2021 <jsp:setProperty name="formhandler" property="*" />
    21  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     22 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2223 <jsp:getProperty name="formhandler" property="allMessages" />
    2324<div class="configure">
  • apps/routerconsole/jsp/configadvanced.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112
    1213<jsp:useBean class="net.i2p.router.web.ConfigAdvancedHelper" id="advancedhelper" scope="request" />
    13 <jsp:setProperty name="advancedhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14<jsp:setProperty name="advancedhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415
    1516<h1><%=intl._("I2P Advanced Configuration")%></h1>
     
    2122 <% formhandler.storeMethod(request.getMethod()); %>
    2223 <jsp:setProperty name="formhandler" property="*" />
    23  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     24 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2425 <jsp:getProperty name="formhandler" property="allMessages" />
    2526 <div class="configure">
  • apps/routerconsole/jsp/configclients.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1516
    1617<jsp:useBean class="net.i2p.router.web.ConfigClientsHelper" id="clientshelper" scope="request" />
    17 <jsp:setProperty name="clientshelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    18 <jsp:setProperty name="clientshelper" property="edit" value="<%=request.getParameter("edit")%>" />
     18<jsp:setProperty name="clientshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     19<jsp:setProperty name="clientshelper" property="edit" value="<%=request.getParameter(\"edit\")%>" />
    1920<h1><%=intl._("I2P Client Configuration")%></h1>
    2021<div class="main" id="main">
     
    2324 <jsp:useBean class="net.i2p.router.web.ConfigClientsHandler" id="formhandler" scope="request" />
    2425 <% formhandler.storeMethod(request.getMethod()); %>
    25  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    26  <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter("action")%>" />
    27  <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter("nonce")%>" />
     26 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     27 <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter(\"action\")%>" />
     28 <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter(\"nonce\")%>" />
    2829 <jsp:setProperty name="formhandler" property="settings" value="<%=request.getParameterMap()%>" />
    2930 <jsp:getProperty name="formhandler" property="allMessages" />
  • apps/routerconsole/jsp/configkeyring.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1617 <% formhandler.storeMethod(request.getMethod()); %>
    1718 <jsp:setProperty name="formhandler" property="*" />
    18  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     19 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1920 <jsp:getProperty name="formhandler" property="allMessages" />
    2021 <jsp:useBean class="net.i2p.router.web.ConfigKeyringHelper" id="keyringhelper" scope="request" />
    21  <jsp:setProperty name="keyringhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     22 <jsp:setProperty name="keyringhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2223<div class="configure"><h2><%=intl._("Keyring")%></h2><p>
    2324 <%=intl._("The router keyring is used to decrypt encrypted leaseSets.")%>
  • apps/routerconsole/jsp/configlogging.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    89</head><body>
    910<jsp:useBean class="net.i2p.router.web.ConfigLoggingHelper" id="logginghelper" scope="request" />
    10 <jsp:setProperty name="logginghelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     11<jsp:setProperty name="logginghelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1112
    1213<%@include file="summary.jsi" %>
     
    1819 <% formhandler.storeMethod(request.getMethod()); %>
    1920 <jsp:setProperty name="formhandler" property="*" />
    20  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     21 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2122 <jsp:getProperty name="formhandler" property="allMessages" />
    2223<div class="configure">
  • apps/routerconsole/jsp/confignav.jsi

    r7df8814 r23ca49ea  
    55%>
    66<jsp:useBean class="net.i2p.router.web.ConfigNavHelper" id="navHelper" scope="request" />
    7 <jsp:setProperty name="navHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     7<jsp:setProperty name="navHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    88<% navHelper.storeWriter(out); %>
    99<div class="confignav" id="confignav">
  • apps/routerconsole/jsp/confignet.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html" %>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112
    1213<jsp:useBean class="net.i2p.router.web.ConfigNetHelper" id="nethelper" scope="request" />
    13 <jsp:setProperty name="nethelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14<jsp:setProperty name="nethelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415<h1><%=intl._("I2P Network Configuration")%></h1>
    1516<div class="main" id="main">
     
    1920 <% formhandler.storeMethod(request.getMethod()); %>
    2021 <jsp:setProperty name="formhandler" property="*" />
    21  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     22 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2223 <jsp:getProperty name="formhandler" property="allMessages" />
    2324<div class="configure">
  • apps/routerconsole/jsp/configpeer.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1617 <% formhandler.storeMethod(request.getMethod()); %>
    1718 <jsp:setProperty name="formhandler" property="*" />
    18  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     19 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1920 <jsp:getProperty name="formhandler" property="allMessages" />
    2021
     
    2223
    2324 <jsp:useBean class="net.i2p.router.web.ConfigPeerHelper" id="peerhelper" scope="request" />
    24  <jsp:setProperty name="peerhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     25 <jsp:setProperty name="peerhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2526
    2627 <% String peer = "";
     
    6263 <a name="shitlist"> </a><h2><%=intl._("Banned Peers")%></h2>
    6364 <jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" />
    64  <jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     65 <jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    6566 <% profilesHelper.storeWriter(out); %>
    6667 <jsp:getProperty name="profilesHelper" property="shitlistSummary" />
  • apps/routerconsole/jsp/configreseed.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112
    1213<jsp:useBean class="net.i2p.router.web.ConfigReseedHelper" id="reseedHelper" scope="request" />
    13 <jsp:setProperty name="reseedHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14<jsp:setProperty name="reseedHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415<h1><%=intl._("I2P Reseeding Configuration")%></h1>
    1516<div class="main" id="main">
     
    1819<jsp:useBean class="net.i2p.router.web.ConfigReseedHandler" id="formhandler" scope="request" />
    1920<% formhandler.storeMethod(request.getMethod()); %>
    20 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    21 <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter("action")%>" />
    22 <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter("nonce")%>" />
     21<jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     22<jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter(\"action\")%>" />
     23<jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter(\"nonce\")%>" />
    2324<jsp:setProperty name="formhandler" property="settings" value="<%=request.getParameterMap()%>" />
    2425<jsp:getProperty name="formhandler" property="allMessages" />
  • apps/routerconsole/jsp/configservice.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1617 <% formhandler.storeMethod(request.getMethod()); %>
    1718 <jsp:setProperty name="formhandler" property="*" />
    18  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     19 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1920 <jsp:getProperty name="formhandler" property="allMessages" />
    2021 <div class="configure">
  • apps/routerconsole/jsp/configstats.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    6566 <% formhandler.storeMethod(request.getMethod()); %>
    6667 <jsp:setProperty name="formhandler" property="*" />
    67  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     68 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    6869 <jsp:getProperty name="formhandler" property="allMessages" />
    6970
    7071 <jsp:useBean class="net.i2p.router.web.ConfigStatsHelper" id="statshelper" scope="request" />
    71  <jsp:setProperty name="statshelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     72 <jsp:setProperty name="statshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    7273 <div class="configure">
    7374 <form id="statsForm" name="statsForm" action="" method="POST">
  • apps/routerconsole/jsp/configtunnels.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112
    1213<jsp:useBean class="net.i2p.router.web.ConfigTunnelsHelper" id="tunnelshelper" scope="request" />
    13 <jsp:setProperty name="tunnelshelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14<jsp:setProperty name="tunnelshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415<h1><%=intl._("I2P Tunnel Configuration")%></h1>
    1516<div class="main" id="main">
     
    1718 <jsp:useBean class="net.i2p.router.web.ConfigTunnelsHandler" id="formhandler" scope="request" />
    1819 <% formhandler.storeMethod(request.getMethod()); %>
    19  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    20  <jsp:setProperty name="formhandler" property="shouldsave" value="<%=request.getParameter("shouldsave")%>" />
    21  <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter("action")%>" />
    22  <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter("nonce")%>" />
     20 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     21 <jsp:setProperty name="formhandler" property="shouldsave" value="<%=request.getParameter(\"shouldsave\")%>" />
     22 <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter(\"action\")%>" />
     23 <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter(\"nonce\")%>" />
    2324 <jsp:setProperty name="formhandler" property="settings" value="<%=request.getParameterMap()%>" />
    2425 <jsp:getProperty name="formhandler" property="allMessages" />
  • apps/routerconsole/jsp/configui.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112
    1213<jsp:useBean class="net.i2p.router.web.ConfigUIHelper" id="uihelper" scope="request" />
    13 <jsp:setProperty name="uihelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14<jsp:setProperty name="uihelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415
    1516<h1><%=uihelper._("I2P UI Configuration")%></h1>
     
    2122 <% formhandler.storeMethod(request.getMethod()); %>
    2223 <jsp:setProperty name="formhandler" property="*" />
    23  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     24 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2425 <jsp:getProperty name="formhandler" property="allMessages" />
    2526<div class="configure"><div class="topshimten"><h3><%=uihelper._("Router Console Theme")%></h3></div>
  • apps/routerconsole/jsp/configupdate.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1617 <% formhandler.storeMethod(request.getMethod()); %>
    1718 <jsp:setProperty name="formhandler" property="*" />
    18  <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     19 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1920 <jsp:getProperty name="formhandler" property="allMessages" />
    2021 <jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" />
    21  <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     22 <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2223<div class="messages">
    2324 <jsp:getProperty name="updatehelper" property="newsStatus" /></div>
  • apps/routerconsole/jsp/css.jsi

    r7df8814 r23ca49ea  
    2828<link rel="shortcut icon" href="/themes/console/images/favicon.ico">
    2929<jsp:useBean class="net.i2p.router.web.CSSHelper" id="intl" scope="request" />
    30 <jsp:setProperty name="intl" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     30<jsp:setProperty name="intl" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    3131<%
    3232   String conNonceParam = request.getParameter("consoleNonce");
  • apps/routerconsole/jsp/debug.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/dumpprofile.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/plain"
    22%><jsp:useBean id="helper" class="net.i2p.router.web.StatHelper"
    3 /><jsp:setProperty name="helper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>"
    4 /><jsp:setProperty name="helper" property="peer" value="<%=net.i2p.data.DataHelper.stripHTML(request.getParameter("peer"))%>"
     3/><jsp:setProperty name="helper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>"
     4/><jsp:setProperty name="helper" property="peer" value="<%=net.i2p.data.DataHelper.stripHTML(request.getParameter(\"peer\"))%>"
    55/><% helper.storeWriter(out);
    66%><jsp:getProperty name="helper" property="profile" />
  • apps/routerconsole/jsp/error.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/error500.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    5859<b>Wrapper version:</b> <%=System.getProperty("wrapper.version", "none")%><br>
    5960 <jsp:useBean class="net.i2p.router.web.LogsHelper" id="logsHelper" scope="request" />
    60  <jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     61 <jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    6162<b>Server version:</b> <jsp:getProperty name="logsHelper" property="jettyVersion" /><br>
    6263<b>Platform:</b> <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br>
  • apps/routerconsole/jsp/graphs.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    89 <jsp:useBean class="net.i2p.router.web.GraphHelper" id="graphHelper" scope="request" />
    910 <% graphHelper.storeMethod(request.getMethod()); %>
    10  <jsp:setProperty name="graphHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     11 <jsp:setProperty name="graphHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1112<% /* GraphHelper sets the defaults in setContextId, so setting the properties must be after the context */ %>
    1213 <jsp:setProperty name="graphHelper" property="*" />
  • apps/routerconsole/jsp/help.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/help_ar.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/help_fr.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/help_nl.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/help_ru.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/index.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1819<div class="news" id="news">
    1920 <jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" />
    20  <jsp:setProperty name="newshelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     21 <jsp:setProperty name="newshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2122<%
    2223   if (newshelper.shouldShowNews()) {
     
    3132%>
    3233 <jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" />
    33  <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     34 <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    3435 <jsp:getProperty name="updatehelper" property="newsStatus" /><br>
    3536</div><div class="main" id="main">
     
    6162 <jsp:setProperty name="contenthelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
    6263 <jsp:setProperty name="contenthelper" property="maxLines" value="300" />
    63  <jsp:setProperty name="contenthelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     64 <jsp:setProperty name="contenthelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    6465 <jsp:getProperty name="contenthelper" property="content" />
    6566</div></body></html>
  • apps/routerconsole/jsp/jobs.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1011<div class="main" id="main">
    1112 <jsp:useBean class="net.i2p.router.web.JobQueueHelper" id="jobQueueHelper" scope="request" />
    12  <jsp:setProperty name="jobQueueHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     13 <jsp:setProperty name="jobQueueHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1314 <% jobQueueHelper.storeWriter(out); %>
    1415 <jsp:getProperty name="jobQueueHelper" property="jobQueueSummary" />
  • apps/routerconsole/jsp/logs.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    2324<b>Wrapper version:</b> <%=System.getProperty("wrapper.version", "none")%><br>
    2425 <jsp:useBean class="net.i2p.router.web.LogsHelper" id="logsHelper" scope="request" />
    25  <jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     26 <jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2627<b>Server version:</b> <jsp:getProperty name="logsHelper" property="jettyVersion" /><br>
    2728<b>Platform:</b> <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br>
  • apps/routerconsole/jsp/netdb.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1213 <div class="wideload">
    1314 <jsp:useBean class="net.i2p.router.web.NetDbHelper" id="netdbHelper" scope="request" />
    14  <jsp:setProperty name="netdbHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     15 <jsp:setProperty name="netdbHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1516 <% netdbHelper.storeWriter(out); %>
    16  <jsp:setProperty name="netdbHelper" property="full" value="<%=request.getParameter("f")%>" />
    17  <jsp:setProperty name="netdbHelper" property="router" value="<%=request.getParameter("r")%>" />
    18  <jsp:setProperty name="netdbHelper" property="lease" value="<%=request.getParameter("l")%>" />
     17 <jsp:setProperty name="netdbHelper" property="full" value="<%=request.getParameter(\"f\")%>" />
     18 <jsp:setProperty name="netdbHelper" property="router" value="<%=request.getParameter(\"r\")%>" />
     19 <jsp:setProperty name="netdbHelper" property="lease" value="<%=request.getParameter(\"l\")%>" />
    1920 <jsp:getProperty name="netdbHelper" property="netDbSummary" />
    2021</div></div></body></html>
  • apps/routerconsole/jsp/nowebapp.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/oldconsole.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1213<%@include file="summary.jsi" %>
    1314<jsp:useBean class="net.i2p.router.web.OldConsoleHelper" id="conhelper" scope="request" />
    14 <jsp:setProperty name="conhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     15<jsp:setProperty name="conhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1516<% conhelper.storeWriter(out); %>
    1617 <h1>I2P Router &raquo; Old Console</h1>
  • apps/routerconsole/jsp/peers.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1112<div class="main" id="main"><div class="wideload">
    1213 <jsp:useBean class="net.i2p.router.web.PeerHelper" id="peerHelper" scope="request" />
    13  <jsp:setProperty name="peerHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     14 <jsp:setProperty name="peerHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1415 <% peerHelper.storeWriter(out); %>
    1516 <jsp:setProperty name="peerHelper" property="urlBase" value="peers.jsp" />
    16  <jsp:setProperty name="peerHelper" property="sort" value="<%=request.getParameter("sort") != null ? request.getParameter("sort") : ""%>" />
     17 <jsp:setProperty name="peerHelper" property="sort" value="<%=request.getParameter(\"sort\") != null ? request.getParameter(\"sort\") : \"\"%>" />
    1718 <jsp:getProperty name="peerHelper" property="peerSummary" />
    1819</div></div></body></html>
  • apps/routerconsole/jsp/profiles.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1011<div class="main" id="main"><div class="wideload">
    1112 <jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" />
    12  <jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     13 <jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1314 <% profilesHelper.storeWriter(out); %>
    14  <jsp:setProperty name="profilesHelper" property="full" value="<%=request.getParameter("f")%>" />
     15 <jsp:setProperty name="profilesHelper" property="full" value="<%=request.getParameter(\"f\")%>" />
    1516 <jsp:getProperty name="profilesHelper" property="profileSummary" />
    1617 <a name="shitlist"> </a><h2><%=intl._("Banned Peers")%></h2>
  • apps/routerconsole/jsp/stats.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    910<%@include file="summary.jsi" %>
    1011<jsp:useBean class="net.i2p.router.web.OldConsoleHelper" id="oldhelper" scope="request" />
    11 <jsp:setProperty name="oldhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     12<jsp:setProperty name="oldhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1213<% oldhelper.storeWriter(out); %>
    13 <jsp:setProperty name="oldhelper" property="full" value="<%=request.getParameter("f")%>" />
     14<jsp:setProperty name="oldhelper" property="full" value="<%=request.getParameter(\"f\")%>" />
    1415 <h1><%=intl._("I2P Router Statistics")%></h1>
    1516<div class="main" id="main">
  • apps/routerconsole/jsp/summaryframe.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • apps/routerconsole/jsp/summarynoframe.jsi

    r7df8814 r23ca49ea  
    77%>
    88<jsp:useBean class="net.i2p.router.web.SummaryHelper" id="helper" scope="request" />
    9 <jsp:setProperty name="helper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    10 <jsp:setProperty name="helper" property="action" value="<%=request.getParameter("action")%>" />
    11 <jsp:setProperty name="helper" property="updateNonce" value="<%=request.getParameter("updateNonce")%>" />
    12 <jsp:setProperty name="helper" property="consoleNonce" value="<%=request.getParameter("consoleNonce")%>" />
     9<jsp:setProperty name="helper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     10<jsp:setProperty name="helper" property="action" value="<%=request.getParameter(\"action\")%>" />
     11<jsp:setProperty name="helper" property="updateNonce" value="<%=request.getParameter(\"updateNonce\")%>" />
     12<jsp:setProperty name="helper" property="consoleNonce" value="<%=request.getParameter(\"consoleNonce\")%>" />
    1313<jsp:setProperty name="helper" property="requestURI" value="<%=request.getRequestURI()%>" />
    1414<% helper.storeWriter(out); %>
     
    2929<jsp:useBean class="net.i2p.router.web.UpdateHandler" id="update" scope="request" />
    3030<jsp:setProperty name="update" property="*" />
    31 <jsp:setProperty name="update" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     31<jsp:setProperty name="update" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    3232<%
    3333    // moved to java for ease of translation and to avoid 30 copies
  • apps/routerconsole/jsp/tunnels.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1011<div class="main" id="main">
    1112 <jsp:useBean class="net.i2p.router.web.TunnelHelper" id="tunnelHelper" scope="request" />
    12  <jsp:setProperty name="tunnelHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     13 <jsp:setProperty name="tunnelHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1314 <% tunnelHelper.storeWriter(out); %>
    1415 <jsp:getProperty name="tunnelHelper" property="tunnelSummary" />
  • apps/routerconsole/jsp/viewprofile.jsp

    r7df8814 r23ca49ea  
    11<%@page contentType="text/html"%>
     2<%@page trimDirectiveWhitespaces="true"%>
    23<%@page pageEncoding="UTF-8"%>
    34<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    1819%>
    1920<jsp:useBean id="stathelper" class="net.i2p.router.web.StatHelper" />
    20 <jsp:setProperty name="stathelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     21<jsp:setProperty name="stathelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    2122<jsp:setProperty name="stathelper" property="peer" value="<%=peerB64%>" />
    2223<% stathelper.storeWriter(out); %>
  • apps/susidns/src/build.xml

    r7df8814 r23ca49ea  
    1818        <pathelement location="${lib}/jasper-runtime.jar" />
    1919        <pathelement location="${lib}/javax.servlet.jar" />
     20        <pathelement location="${lib}/jsp-api.jar" />
    2021        <pathelement location="${lib}/commons-logging.jar" />
    2122        <pathelement location="${lib}/commons-el.jar" />
  • apps/susidns/src/jsp/addressbook.jsp

    r7df8814 r23ca49ea  
    3030%>
    3131<%@page pageEncoding="UTF-8"%>
     32<%@page trimDirectiveWhitespaces="true"%>
    3233<%@ page contentType="text/html"%>
    3334<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  • apps/susidns/src/jsp/config.jsp

    r7df8814 r23ca49ea  
    3030%>
    3131<%@page pageEncoding="UTF-8"%>
     32<%@page trimDirectiveWhitespaces="true"%>
    3233<%@ page contentType="text/html" %>
    3334<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  • apps/susidns/src/jsp/details.jsp

    r7df8814 r23ca49ea  
    2727%>
    2828<%@page pageEncoding="UTF-8"%>
     29<%@page trimDirectiveWhitespaces="true"%>
    2930<%@ page contentType="text/html"%>
    3031<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  • apps/susidns/src/jsp/index.jsp

    r7df8814 r23ca49ea  
    3030%>
    3131<%@page pageEncoding="UTF-8"%>
     32<%@page trimDirectiveWhitespaces="true"%>
    3233<%@ page contentType="text/html"%>
    3334<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  • apps/susidns/src/jsp/subscriptions.jsp

    r7df8814 r23ca49ea  
    3030%>
    3131<%@page pageEncoding="UTF-8"%>
     32<%@page trimDirectiveWhitespaces="true"%>
    3233<%@ page contentType="text/html"%>
    3334<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  • apps/susimail/build.xml

    r7df8814 r23ca49ea  
    2020                <pathelement location="../jetty/jettylib/javax.servlet.jar" />
    2121                <pathelement location="../jetty/jettylib/org.mortbay.jetty.jar" />
     22                <pathelement location="../jetty/jettylib/jetty-util.jar" />
    2223                <pathelement location="../../core/java/build/i2p.jar" />
    2324            </classpath>
  • apps/susimail/src/WEB-INF/web.xml

    r7df8814 r23ca49ea  
    1616    <session-timeout>15</session-timeout>
    1717  </session-config>
    18 </web-app>
     18
     19<!--
     20     Jetty 6 mulipart form handling
     21     See http://docs.codehaus.org/display/JETTY/File+Upload+in+jetty6
     22     and RequestWrapper.java.
     23     Unused because it doesn't support content-type until Jetty 8.
     24
     25    <filter>
     26        <filter-name>fileuploadfilter</filter-name>
     27        <filter-class>org.mortbay.servlet.MultiPartFilter</filter-class>
     28        <init-param>
     29            <param-name>deleteFiles</param-name>
     30            <param-value>true</param-value>
     31        </init-param>
     32    </filter>
     33
     34    <filter-mapping>
     35        <filter-name>fileuploadfilter</filter-name>
     36        <url-pattern>/susimail</url-pattern>
     37    </filter-mapping>
     38-->
     39
     40-</web-app>
  • apps/susimail/src/src/i2p/susi/webmail/RequestWrapper.java

    r7df8814 r23ca49ea  
    3636
    3737/**
     38 *  Required major changes for Jetty 6
     39 *  to support change from MultiPartRequest to MultiPartFilter.
     40 *  See http://docs.codehaus.org/display/JETTY/File+Upload+in+jetty6
     41 *  Unfortunately, Content-type not available until Jetty 8
     42 *  See https://bugs.eclipse.org/bugs/show_bug.cgi?id=349110
     43 *
     44 *  So we could either extend and fix MultiPartFilter, and rewrite everything here,
     45 *  or copy MultiParRequest into our war and fix it so it compiles with Jetty 6.
     46 *  We do the latter.
     47 *
     48 *  The filter would have been added in web.xml,
     49 *  see that file, where it's commented out.
     50 *
    3851 * @author user
    3952 */
  • apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java

    r7df8814 r23ca49ea  
    7878                   test.close();
    7979                } catch (IOException ioe) {}
     80                // Jetty 6 seems to start the Connector before the
     81                // webapp is completely ready
     82                try {
     83                   Thread.sleep(2*1000);
     84                } catch (InterruptedException ie) {}
    8085                return true;
    8186            } catch (Exception e) {}
  • build.properties

    r7df8814 r23ca49ea  
    1111# Note: Include the trailing slash! Don't surround the URL in quotes!
    1212javasedocs.url=http://docs.oracle.com/javase/6/docs/api/
    13 jettydocs.url=http://docs.i2p2.de/jetty/javadoc/
     13jettydocs.url=http://jetty.codehaus.org/jetty/jetty-6/apidocs/
    1414jrobindocs.url=http://docs.i2p-projekt.de/jrobin/javadoc/
    1515wrapperdocs.url=http://wrapper.tanukisoftware.com/jdoc/
  • build.xml

    r7df8814 r23ca49ea  
    3737        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
    3838        <echo message="  updaterWithJetty: Updater including Jetty" />
     39        <echo message="  updater200withJetty: Updater including Jetty" />
    3940        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
    4041        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
     
    5152        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
    5253        <echo message="  debianhowto: instructions on building Debian packages" />
    53         <echo message="  debian: generate Debian packages in ../" />
    54         <echo message="          run &quot;ant debianhowto&quot; for instructions" />
    55         <echo message="  debian-clean: rollback debian specific patches and run the &quot;distclean&quot; target (done automatically at the end of the &quot;debian&quot; target)" />
    56         <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
     54        <echo message="  debian: generate Debian packages in ../" />
     55        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
     56        <echo message="  debian-clean: rollback debian specific patches and run the &quot;distclean&quot; target (done automatically at the end of the &quot;debian&quot; target)" />
     57        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
    5758        <echo message="  poupdate: update the .po files for translators" />
    5859        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
    5960   </target>
    6061    <target name="debianhowto">
    61             <echo message="To build debian packages, you must make sure that you have" />
    62             <echo message="the necessary build-dependencies installed." />
    63             <echo message="The packages required to build can be found in the file "/>
    64             <echo message="&quot;debian/control&quot; in both the Build-Depends and Build-Depends-Indep fields."/>
    65             <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
    66             <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
    67             <echo message="" />
    68             <echo message="The following command will install all dependencies for you:" />
    69             <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential quilt" />
    70             <echo message=" " />
    71             <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
    72             <echo message="to patch the source and build the packages." />
     62            <echo message="To build debian packages, you must make sure that you have" />
     63            <echo message="the necessary build-dependencies installed." />
     64            <echo message="The packages required to build can be found in the file "/>
     65            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
     66            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
     67            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
     68            <echo message="" />
     69            <echo message="The following command will install all of the dependencies for you:" />
     70            <echo message=" " />
     71            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential \" />
     72            <echo message="                   quilt libcommons-el-java libcommons-logging-java libjetty-extra-java libjetty-java" />
     73            <echo message=" " />
     74            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
     75            <echo message="to patch the source and build the packages." />
    7376    </target>
    7477    <target name="dist" depends="pkg, javadoc">
     
    133136    </target>
    134137
    135     <target name="buildJetty" depends="buildProperties" >
     138    <target name="buildJetty" depends="buildCore" >
    136139        <ant dir="apps/jetty" target="build" />
    137140    </target>
     
    196199        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
    197200        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
    198         <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
    199         <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
    200         <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
    201         <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
    202         <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
    203         <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
     201        <copy todir="build/" >
     202            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
     203        </copy>
    204204    </target>
    205205
     
    401401            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
    402402            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
     403            <group title="Jetty Logging" packages="org.mortbay.http" />
    403404            <group title="SAM Bridge" packages="net.i2p.sam:net.i2p.sam.client" />
    404405            <group title="SusiDNS Application" packages="i2p.susi.dns" />
    405             <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
     406            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util:org.mortbay.servlet:org.mortbay.util" />
    406407            <group title="Systray Application" packages="net.i2p.apps.systray" />
    407408            <sourcepath>
     
    422423                <pathelement location="apps/susidns/src/java/src" />
    423424                <pathelement location="apps/susimail/src/src" />
     425                <pathelement location="apps/jetty/java/src" />
    424426            </sourcepath>
    425427            <classpath>
    426428                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
    427429                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
     430                <pathelement location="apps/jetty/jettylib/jetty-sslengine.jar" />
     431                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
     432                <pathelement location="apps/jetty/jettylib/jetty-java5-threadpool.jar" />
     433                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
     434                <pathelement location="apps/jetty/jettylib/jsp-api.jar" />
    428435                <pathelement location="apps/systray/java/lib/systray4j.jar" />
    429436                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
     
    570577    </target>
    571578
     579    <target name="webappDistclean">
     580        <ant dir="apps/i2ptunnel/java/" target="distclean" />
     581        <ant dir="apps/routerconsole/java/" target="distclean" />
     582        <ant dir="apps/addressbook/" target="distclean" />
     583        <ant dir="apps/susimail/" target="distclean" />
     584        <ant dir="apps/susidns/src/" target="distclean" />
     585        <ant dir="apps/i2psnark/java/" target="distclean" />
     586    </target>
     587
    572588    <target name="pkg" depends="distclean, updater, preppkg, installer" />
    573589
     
    689705        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
    690706        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
    691         <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
    692         <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
    693         <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
    694         <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
    695         <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
     707        <!-- all jetty stuff -->
     708        <copy todir="pkg-temp/lib" >
     709            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.jetty.jar" />
     710        </copy>
    696711        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
    697712        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
    698         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    699713        <copy file="build/router.jar" todir="pkg-temp/lib/" />
    700714        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
     
    743757        <!-- Eepsite stuff here -->
    744758        <mkdir dir="pkg-temp/eepsite" />
    745         <mkdir dir="pkg-temp/eepsite/webapps" />
    746         <mkdir dir="pkg-temp/eepsite/logs" />
    747         <mkdir dir="pkg-temp/eepsite/cgi-bin" />
    748         <mkdir dir="pkg-temp/eepsite/docroot" />
    749         <mkdir dir="pkg-temp/eepsite/docroot/help" />
    750         <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
    751         <copy todir="pkg-temp/eepsite/docroot/" >
    752             <fileset dir="installer/resources/eepsite.help/" />
     759        <copy todir="pkg-temp/eepsite/" >
     760            <fileset dir="installer/resources/eepsite/" />
    753761        </copy>
    754762        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
     
    756764        </copy>
    757765        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
    758         <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
    759766    </target>
    760767
     
    770777         -->
    771778        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
     779        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
    772780        <!--  Not sure if these are used or should be included -->
    773781        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
     
    836844    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
    837845    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
     846    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
    838847    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
    839848    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
     
    952961    </target>
    953962
     963    <!-- All jetty jars required for update.
     964         We don't need commons-el or commons-logging, they haven't changed.
     965         TODO do we need to bother updating jasper?
     966         TODO where is JMX? We don't need it I hope.
     967      -->
    954968    <target name="prepjupdate" depends="prepupdate, buildWEB">
    955         <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
    956         <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
    957         <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
    958         <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
    959         <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
    960         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    961     </target>
     969        <copy todir="pkg-temp/lib" >
     970            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.jetty.jar" />
     971        </copy>
     972        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
     973              can't overwrite an existing eepsite dir in a non-split configuration.
     974          -->
     975        <copy todir="pkg-temp/eepsite-jetty6" >
     976            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
     977        </copy>
     978    </target>
     979
     980    <!-- Jetty 6 I2P logging addons, not really fixes -->
    962981    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
    963         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
     982        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
    964983    </target>
    965984
     
    13931412    <target name="debian-binary" >
    13941413        <echo message="Did you update the version using dch -i?" />
    1395         <echo message=" " />
    1396         <echo message="If the changelog was not updated with dch -i, press" />
    1397         <echo message="press CTRL+C to abort building this Debian package." />
    1398         <echo message="" />
    1399         <echo message="Pausing build for ten seconds to give enough time to read this notice." />
    1400         <exec executable="sleep" failonerror="true">
    1401                 <arg value="10" />
    1402         </exec>
     1414        <echo message=" " />
     1415        <echo message="If the changelog was not updated with dch -i, press" />
     1416        <echo message="press CTRL+C to abort building this Debian package." />
     1417        <echo message="" />
     1418        <echo message="Pausing build for ten seconds to give enough time to read this notice." />
     1419        <exec executable="sleep" failonerror="true">
     1420                <arg value="10" />
     1421        </exec>
    14031422        <echo message="====================" />
    1404         <!-- bundle the jetty 5 lib since there isn't a deb for it -->
    1405         <ant dir="apps/jetty" target="ensureJettylib" />
    1406        
    1407         <exec executable="fakeroot" failonerror="true">
    1408             <arg value="debian/rules" />
    1409             <arg value="patch" />
    1410             <arg value="binary" />
    1411             <arg value="clean" />
    1412         </exec>
    1413         <delete dir=".pc" />
    1414     </target>
     1423
     1424        <exec executable="fakeroot" failonerror="true">
     1425            <arg value="debian/rules" />
     1426            <arg value="patch" />
     1427            <arg value="binary" />
     1428            <arg value="clean" />
     1429        </exec>
     1430        <delete dir=".pc" />
     1431    </target>
     1432
    14151433    <target name="debian-clean" depends="buildProperties" >
    14161434        <exec executable="fakeroot" failonerror="true">
    1417             <arg value="debian/rules" />
    1418             <arg value="clean" />
    1419         </exec>
    1420         <delete dir="./.pc" />
    1421     </target>
     1435            <arg value="debian/rules" />
     1436            <arg value="clean" />
     1437        </exec>
     1438        <delete dir="./.pc" />
     1439    </target>
     1440
    14221441    <target name="debian-patch" depends="buildProperties" >
    14231442        <exec executable="quilt" failonerror="true">
     
    14291448    <target name="debian-unpatch" depends="buildProperties">
    14301449        <exec executable="quilt" failonerror="false">
    1431             <arg value="-a" />
    1432             <arg value="pop" />
     1450            <arg value="-a" />
     1451            <arg value="pop" />
    14331452        </exec>
    14341453    </target>
  • debian/control

    r7df8814 r23ca49ea  
    1111 default-jdk,
    1212 gettext,
     13 libcommons-el-java,
     14 libcommons-logging-java,
    1315 libgmp3-dev,
     16 libjetty-extra-java,
     17 libjetty-java,
    1418 po-debconf
    15 ##Build-Depends-Indep: tor-geoipdb
    1619
    1720Package: i2p
     
    6669Section: net
    6770Priority: optional
    68 Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends}, default-jre-headless | java5-runtime-headless | java6-runtime-headless
     71Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends},
     72 default-jre-headless | java5-runtime-headless | java6-runtime-headless,
     73 libcommons-logging-java,
     74 libjetty-java,
     75 libtomcat6-java
    6976Replaces: i2p ( << 0.8.6-5)
    7077Breaks: i2p (<< 0.8.6-5)
  • debian/i2p-router.install

    r7df8814 r23ca49ea  
     1# history.txt is installed to /usr/share/i2p because
     2# it's shown in the router console at http://127.0.0.1:7657
     3# (this is also why I don't use dh_installchangelogs -k for it)
    14history.txt usr/share/i2p
     5
    26pkg-temp/blocklist.txt usr/share/i2p
    37pkg-temp/certificates usr/share/i2p
     
    1115pkg-temp/i2psnark.config usr/share/i2p
    1216pkg-temp/i2ptunnel.config usr/share/i2p
    13 pkg-temp/lib/*.jar usr/share/i2p/lib
    1417pkg-temp/router.config usr/share/i2p
    1518pkg-temp/systray.config usr/share/i2p
    1619pkg-temp/webapps usr/share/i2p
     20
     21# We'll selectively copy things from pkg-temp
     22# to ensure that potential Jetty jars aren't
     23# duplicated
     24pkg-temp/lib/BOB.jar usr/share/i2p/lib
     25pkg-temp/lib/desktopgui.jar usr/share/i2p/lib
     26pkg-temp/lib/i2p.jar usr/share/i2p/lib
     27pkg-temp/lib/i2psnark.jar usr/share/i2p/lib
     28pkg-temp/lib/i2ptunnel.jar usr/share/i2p/lib
     29pkg-temp/lib/jetty-i2p.jar usr/share/i2p/lib
     30pkg-temp/lib/jrobin.jar usr/share/i2p/lib
     31pkg-temp/lib/mstreaming.jar usr/share/i2p/lib
     32pkg-temp/lib/router.jar usr/share/i2p/lib
     33pkg-temp/lib/routerconsole.jar usr/share/i2p/lib
     34pkg-temp/lib/sam.jar usr/share/i2p/lib
     35pkg-temp/lib/standard.jar usr/share/i2p/lib
     36pkg-temp/lib/streaming.jar usr/share/i2p/lib
     37pkg-temp/lib/systray.jar usr/share/i2p/lib
     38pkg-temp/lib/systray4j.jar usr/share/i2p/lib
     39
     40# These are copied over to avoid depending on libjetty-extra-java
     41# and pulling in dependencies that we don't care about
     42pkg-temp/lib/commons-el.jar usr/share/i2p/lib
     43pkg-temp/lib/jetty-java5-threadpool.jar usr/share/i2p/lib
     44pkg-temp/lib/jetty-rewrite-handler.jar usr/share/i2p/lib
  • debian/i2p-router.links

    r7df8814 r23ca49ea  
    33usr/share/common-licenses/Apache-2.0 usr/share/doc/i2p-router/licenses/LICENSE-Apache2.0.txt
    44usr/share/common-licenses/BSD usr/share/doc/i2p-router/licenses/LICENSE-BSD.txt
     5
     6# From libcommons-logging-java
     7usr/share/java/commons-logging.jar usr/share/i2p/lib/commons-logging.jar
     8# From libtomcat6-java
     9usr/share/java/jasper.jar usr/share/i2p/lib/jasper.jar
     10usr/share/java/jasper-el.jar usr/share/i2p/lib/jasper-el.jar
     11usr/share/java/tomcat-juli.jar usr/share/i2p/lib/tomcat-juli.jar
     12
     13# From libjetty-java
     14usr/share/java/jetty.jar usr/share/i2p/lib/jetty.jar
     15usr/share/java/jetty-util.jar usr/share/i2p/lib/jetty-util.jar
     16usr/share/java/jetty-sslengine.jar usr/share/i2p/lib/jetty-sslengine.jar
     17usr/share/java/jetty-start.jar usr/share/i2p/lib/jetty-start.jar
     18
     19# From libservlet2.5-java
     20usr/share/java/servlet-api-2.5.jar usr/share/i2p/lib/servlet-api.jar
     21usr/share/java/jsp-api-2.1.jar usr/share/i2p/lib/jsp-api.jar
     22usr/share/java/el-api-2.1.jar usr/share/i2p/lib/el-api.jar
  • debian/patches/series

    r7df8814 r23ca49ea  
    330003-renaming-jcpuid.patch
    440004-oom-listener.patch
     5#debian-version.patch
     60004-jetty6.patch
  • debian/rules

    r7df8814 r23ca49ea  
    4444        dh_auto_clean
    4545        ant distclean
    46         # The next line is used by KYTV when building from source packages
    47         #rm -f apps/jetty/jetty-5.1.15.tgz
    4846        rm -f core/c/jbigi/*.[s]o
    4947        rm -rf core/c/jcpuid/lib/
     48        #rm -f $(CURDIR)/installer/lib/wrapper/all/wrapper.jar
    5049        debconf-updatepo
    5150
     
    6362        echo router.updateDisabled=true > $(I2P)/router.config
    6463        mv $(I2P)/runplain.sh $(I2P)/i2prouter-nowrapper
    65         #-cp -fv /usr/share/tor/geoip $(CURDIR)/pkg-temp/geoip/geoip.txt
    6664       
    6765
  • installer/resources/clients.config

    r7df8814 r23ca49ea  
    4141
    4242# run our own eepsite with a seperate jetty instance
    43 clientApp.3.main=org.mortbay.jetty.Server
     43clientApp.3.main=org.mortbay.start.Main
    4444clientApp.3.name=I2P webserver (eepsite)
     45## To use the rewrite handler, edit jetty-rewrite.xml and use:
     46#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-rewrite.xml"
     47## To use local SSL, edit jetty-ssl.xml and use:
     48#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-ssl.xml"
    4549clientApp.3.args="eepsite/jetty.xml"
    4650clientApp.3.delay=30
  • installer/resources/deletelist.txt

    r7df8814 r23ca49ea  
    22# expired cert
    33certificates/r31453.ovh.net
     4# old jetty 5 libs
     5lib/org.mortbay.jmx.jar
  • router/java/src/net/i2p/router/Router.java

    r7df8814 r23ca49ea  
    13551355            // Ideally, do not use I2P classes at all, new or not.
    13561356            try {
    1357                 // TODO move deleteListedFiles() here after a few releases
    1358                 if (ok)
     1357                if (ok) {
     1358                    // We do this here so we may delete old jars before we restart
     1359                    deleteListedFiles();
    13591360                    System.out.println("INFO: Update installed");
    1360                 else
     1361                } else {
    13611362                    System.out.println("ERROR: Update failed!");
     1363                }
    13621364                if (!ok) {
    13631365                    // we can't leave the file in place or we'll continually restart, so rename it
     
    13901392        } else {
    13911393            deleteJbigiFiles();
    1392             // Here so it may be used in the 0.8.12 update
    1393             // TODO move up in a few releases so it is only run after an update
     1394            // It was here starting in 0.8.12 so it could be used the very first time
     1395            // Now moved up so it is usually run only after an update
     1396            // But the first time before jetty 6 it will run here...
     1397            // Here we can't remove jars
    13941398            deleteListedFiles();
    13951399        }
  • router/java/src/net/i2p/router/startup/ClientAppConfig.java

    r7df8814 r23ca49ea  
    132132    /*
    133133     * Go through the properties, and return a List of ClientAppConfig structures
     134     * This is for the router.
    134135     */
    135136    public static List<ClientAppConfig> getClientApps(RouterContext ctx) {
    136137        Properties clientApps = getClientAppProps(ctx);
    137         return getClientApps(clientApps);
     138        List<ClientAppConfig> rv = getClientApps(clientApps);
     139        MigrateJetty.migrate(ctx, rv);
     140        return rv;
    138141    }
    139142
    140143    /*
    141144     * Go through the properties, and return a List of ClientAppConfig structures
     145     * This is for plugins.
    142146     *
    143147     * @since 0.7.12
     
    191195
    192196    /** classpath and stopargs not supported */
    193     public static void writeClientAppConfig(RouterContext ctx, List apps) {
     197    public static void writeClientAppConfig(RouterContext ctx, List<ClientAppConfig> apps) {
    194198        File cfgFile = configFile(ctx);
    195199        FileOutputStream fos = null;
     
    198202            StringBuilder buf = new StringBuilder(2048);
    199203            for(int i = 0; i < apps.size(); i++) {
    200                 ClientAppConfig app = (ClientAppConfig) apps.get(i);
     204                ClientAppConfig app = apps.get(i);
    201205                buf.append(PREFIX).append(i).append(".main=").append(app.className).append("\n");
    202206                buf.append(PREFIX).append(i).append(".name=").append(app.clientName).append("\n");
  • router/java/src/net/i2p/router/startup/WorkingDir.java

    r7df8814 r23ca49ea  
    148148        boolean success = migrate(MIGRATE_BASE, oldDirf, dirf);
    149149        // this one must be after MIGRATE_BASE
    150         success &= migrateJettyXml(oldDirf, dirf);
     150        File oldEep = new File(oldDirf, "eepsite");
     151        File newEep = new File(dirf, "eepsite");
     152        String newPath = newEep.getAbsolutePath() + File.separatorChar;
     153        success &= migrateJettyXml(oldEep, newEep, "jetty.xml", "./eepsite/", newPath);
     154        success &= migrateJettyXml(oldEep, newEep, "jetty-ssl.xml", "./eepsite/", newPath);
     155        success &= migrateJettyXml(oldEep, newEep, "contexts/base-context.xml", "./eepsite/", newPath);
     156        success &= migrateJettyXml(oldEep, newEep, "contexts/cgi-context.xml", "./eepsite/", newPath);
    151157        success &= migrateClientsConfig(oldDirf, dirf);
    152158        // for later news.xml updates (we don't copy initialNews.xml over anymore)
     
    240246                out.println(s);
    241247            }
    242             System.err.println("Copied clients.config with modifications");
     248            System.err.println("Copied " + oldFile + " with modifications");
    243249            return true;
    244250        } catch (IOException ioe) {
    245251            if (in != null) {
    246                 System.err.println("FAILED copy clients.config");
     252                System.err.println("FAILED copy " + oldFile + ": " + ioe);
    247253                return false;
    248254            }
     
    259265     *  do it again with modifications.
    260266     */
    261     private static boolean migrateJettyXml(File olddir, File todir) {
    262         File eepsite1 = new File(olddir, "eepsite");
    263         File oldFile = new File(eepsite1, "jetty.xml");
    264         File eepsite2 = new File(todir, "eepsite");
    265         File newFile = new File(eepsite2, "jetty.xml");
     267    static boolean migrateJettyXml(File olddir, File todir, String filename, String oldString, String newString) {
     268        File oldFile = new File(olddir, filename);
     269        File newFile = new File(todir, filename);
    266270        FileInputStream in = null;
    267271        PrintWriter out = null;
     
    271275            String s = null;
    272276            while ((s = DataHelper.readLine(in)) != null) {
    273                 if (s.indexOf("./eepsite/") >= 0) {
    274                     s = s.replace("./eepsite/", todir.getAbsolutePath() + File.separatorChar + "eepsite" + File.separatorChar);
     277                if (s.indexOf(oldString) >= 0) {
     278                    s = s.replace(oldString, newString);
    275279                }
    276280                out.println(s);
    277281            }
    278282            out.println("<!-- Modified by I2P User dir migration script -->");
    279             System.err.println("Copied jetty.xml with modifications");
     283            System.err.println("Copied " + oldFile + " with modifications");
    280284            return true;
    281285        } catch (IOException ioe) {
    282286            if (in != null) {
    283                 System.err.println("FAILED copy jetty.xml");
     287                System.err.println("FAILED copy " + oldFile + ": " + ioe);
    284288                return false;
    285289            }
     
    337341     * @return true if it was copied successfully
    338342     */
    339     private static boolean copyFile(File src, File dst) {
     343    static boolean copyFile(File src, File dst) {
    340344        if (!src.exists()) return false;
    341345        boolean rv = true;
     
    354358            System.err.println("Copied " + src.getPath());
    355359        } catch (IOException ioe) {
    356             System.err.println("FAILED copy " + src.getPath());
     360            System.err.println("FAILED copy " + src.getPath() + ": " + ioe);
    357361            rv = false;
    358362        } finally {
Note: See TracChangeset for help on using the changeset viewer.