Changeset 6107e38


Ignore:
Timestamp:
Feb 4, 2012 3:42:23 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
45ba9e1
Parents:
d93805e (diff), 061f96a (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 0f4af64e64536c467b623286bce659dd2dfe9342)

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

Files:
26 added
14 deleted
80 edited
15 moved

Legend:

Unmodified
Added
Removed
  • LICENSE.txt

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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" />
     
    6967            </manifest>
    7068        </jar>
     69        <jar destfile="./build/temp-beans.jar" basedir="./build/obj" includes="**/EditBean.class **/IndexBean.class" />
    7170    </target>
    7271
     
    130129    </target>
    131130
     131    <!-- The web classes are now in the war not the jar - they are not part of the API -->
    132132    <target name="war" depends="precompilejsp, bundle, warUpToDate, listChangedFiles2" unless="war.uptodate" >
    133133        <!-- set if unset -->
    134134        <property name="workspace.changes.w.tr" value="" />
     135        <copy file="build/obj/net/i2p/i2ptunnel/web/EditBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
     136        <copy file="build/obj/net/i2p/i2ptunnel/web/IndexBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
    135137        <war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
    136138             basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
     
    172174                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    173175                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    174                 <pathelement location="../../jetty/jettylib/ant.jar" />
     176                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     177                <pathelement location="${ant.home}/lib/ant.jar" />
    175178                <pathelement location="build/i2ptunnel.jar" />
     179                <pathelement location="build/temp-beans.jar" />
    176180            </classpath>
    177181            <arg value="-d" />
    178182            <arg value="../jsp/WEB-INF/classes" />
     183            <arg value="-v" />
    179184            <arg value="-p" />
    180185            <arg value="net.i2p.i2ptunnel.jsp" />
     
    193198                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    194199                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     200                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    195201                <pathelement location="build/i2ptunnel.jar" />
     202                <pathelement location="build/temp-beans.jar" />
    196203            </classpath>
    197204        </javac>
  • apps/i2ptunnel/jsp/edit.jsp

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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              jetty-management: Not used by I2P, but only 34KB and could be useful for eepsites, and we bundled it with Jetty 5
     89              All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
     90        -->
     91        <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
     92        <copy file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
     93        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
     94        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" />
     95        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
     96        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" />
     97        <copy preservelastmodified="true" file="${jetty.base}/lib/management/jetty-management-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
    8298        <delete file="jetty.tar" />
    8399        <delete dir="${jetty.base}" />
     100        <!-- commons-logging.jar not in Jetty 6 but we have it in launch4j so copy it over, we need it
     101             for org.apache.jasper.JspC compiler
     102          -->
     103        <copy preservelastmodified="true" file="../../installer/lib/launch4j/lib/commons-logging.jar" todir="jettylib/" />
     104        <ant target="copyTomcatLib" />
     105    </target>
     106
     107    <!-- Tomcat.
     108         The glassfish jars bundled in Jetty 6 are way too old.
     109         For compatibility with very old I2P installations where the classpath
     110         was set individually in wrapper.config, we rename and combine the jars as follows:
     111         jasper.jar : jasper-runtime.jar
     112         jasper-el.jar + el-api.jar : commons-el.jar
     113         servlet-api.jar + jsp-api.jar : javax.servlet.jar
     114         tomcat-juli.jar : commons-logging.jar
     115         empty jar : jasper-compiler.jar
     116         Also, take NOTICE and LICENSE out of each one, we bundle those separately.
     117     -->
     118    <target name="copyTomcatLib" >
     119        <jar destfile="jettylib/jasper-runtime.jar" >
     120            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper.jar" />
     121        </jar>
     122        <jar destfile="jettylib/commons-el.jar" duplicate="preserve" >
     123            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper-el.jar" />
     124            <zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/el-api.jar" />
     125        </jar>
     126        <jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" >
     127            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/servlet-api.jar" />
     128            <zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/jsp-api.jar" />
     129        </jar>
     130        <jar destfile="jettylib/commons-logging.jar" >
     131            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-juli.jar" />
     132        </jar>
     133        <jar destfile="jettylib/jasper-compiler.jar" />
    84134    </target>
    85135
    86136    <target name="build" depends="jar" />
     137
    87138    <target name="builddep" />
    88139    <target name="compile" depends="builddep, ensureJettylib" >
     
    94145            destdir="./build/obj"
    95146            includeAntRuntime="false"
    96             classpath="./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar" >
     147            classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-util.jar" >
    97148            <compilerarg line="${javac.compilerargs}" />
    98149        </javac>
     
    113164    </target>
    114165
     166    <!-- With Jetty 5 we replaced classes in the jar, but with Jetty 6 we
     167         put our stuff in its own jar so we can work with standard Jetty 6 packages
     168      -->
    115169    <target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
    116170        <!-- set if unset -->
    117171        <property name="workspace.changes.tr" value="" />
    118         <jar destfile="./jettylib/org.mortbay.jetty.jar" basedir="./build/obj" includes="**/*.class" update="true" >
     172        <copy todir="build/obj" file="resources/log4j.properties" />
     173        <jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
    119174            <manifest>
    120175                <attribute name="Build-Date" value="${build.timestamp}" />
     
    126181
    127182    <target name="jarUpToDate">
    128         <uptodate property="jar.uptodate" targetfile="jettylib/org.mortbay.jetty.jar" >
     183        <uptodate property="jar.uptodate" targetfile="jettylib/jetty-i2p.jar" >
    129184            <srcfiles dir= "build/obj" includes="**/*.class" />
    130185        </uptodate>
  • apps/routerconsole/java/build.xml

    rd93805e r6107e38  
    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" />
     
    5560                <pathelement location="../../../router/java/build/router.jar" />
    5661                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     62                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     63                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     64                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
    5765                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     66                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     67                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    5868                <pathelement location="../../systray/java/build/systray.jar" />
    5969                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    237247                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    238248                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    239                 <pathelement location="../../jetty/jettylib/ant.jar" />
     249                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     250                <pathelement location="${ant.home}/lib/ant.jar" />
     251                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    240252                <pathelement location="../../systray/java/build/obj" />
    241253                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    270282                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    271283                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     284                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     285                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     286                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
     287                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     288                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    272289                <pathelement location="../../systray/java/build/obj" />
    273290                <pathelement location="../../systray/java/lib/systray4j.jar" />
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    rd93805e r6107e38  
    1515import net.i2p.router.startup.LoadClientAppsJob;
    1616
    17 import org.mortbay.jetty.Server;
     17import org.mortbay.jetty.handler.ContextHandlerCollection;
    1818
    1919/**
     
    291291     */
    292292    private void startWebApp(String app) {
    293         Server s = WebAppStarter.getConsoleServer();
     293        ContextHandlerCollection s = WebAppStarter.getConsoleServer();
    294294        if (s != null) {
    295295                    try {
  • apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    77import net.i2p.util.VersionComparator;
    88
    9 import org.mortbay.http.Version;
     9import org.mortbay.jetty.Server;
    1010import org.tanukisoftware.wrapper.WrapperManager;
    1111
     
    1616    /** @since 0.8.12 */
    1717    public String getJettyVersion() {
    18         return jettyVersion();
     18        return Server.getVersion();
    1919    }
    20    
     20
    2121    /** @since 0.8.13 */
    2222    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         }
     23        return Server.getVersion();
    3124    }
    3225
  • apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java

    rd93805e r6107e38  
    3333import net.i2p.util.VersionComparator;
    3434
    35 import org.mortbay.jetty.Server;
     35import org.mortbay.jetty.handler.ContextHandlerCollection;
    3636
    3737
     
    262262
    263263        // start console webapps in console/webapps
    264         Server server = WebAppStarter.getConsoleServer();
     264        ContextHandlerCollection server = WebAppStarter.getConsoleServer();
    265265        if (server != null) {
    266266            File consoleDir = new File(pluginDir, "console");
     
    362362
    363363        // stop console webapps in console/webapps
    364         Server server = WebAppStarter.getConsoleServer();
    365         if (server != null) {
     364        //ContextHandlerCollection server = WebAppStarter.getConsoleServer();
     365        //if (server != null) {
    366366        /*
    367367            File consoleDir = new File(pluginDir, "console");
     
    383383                while (wars.hasNext()) {
    384384                    String warName = wars.next();
    385                     WebAppStarter.stopWebApp(server, warName);
     385                    WebAppStarter.stopWebApp(warName);
    386386                }
    387387                pluginWars.get(appName).clear();
    388388            }
    389         }
     389        //}
    390390
    391391        // remove summary bar link
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    rd93805e r6107e38  
    1212import java.util.Properties;
    1313import java.util.StringTokenizer;
     14import java.util.concurrent.Executors;
     15import java.util.concurrent.SynchronousQueue;
     16import java.util.concurrent.TimeUnit;
     17import java.util.concurrent.ThreadFactory;
     18import java.util.concurrent.ThreadPoolExecutor;
    1419
    1520import net.i2p.I2PAppContext;
     
    1823import net.i2p.data.DataHelper;
    1924import net.i2p.desktopgui.Main;
     25import net.i2p.jetty.I2PLogger;
    2026import net.i2p.router.RouterContext;
    2127import net.i2p.util.FileUtil;
     
    2733import net.i2p.util.VersionComparator;
    2834
    29 import org.mortbay.http.DigestAuthenticator;
    30 import org.mortbay.http.HashUserRealm;
    31 import org.mortbay.http.NCSARequestLog;
    32 import org.mortbay.http.SecurityConstraint;
    33 import org.mortbay.http.SocketListener;
    34 import org.mortbay.http.SslListener;
    35 import org.mortbay.http.handler.SecurityHandler;
     35import org.mortbay.jetty.AbstractConnector;
     36import org.mortbay.jetty.Connector;
     37import org.mortbay.jetty.Handler;
     38import org.mortbay.jetty.NCSARequestLog;
    3639import org.mortbay.jetty.Server;
    37 import org.mortbay.jetty.servlet.WebApplicationContext;
    38 import org.mortbay.jetty.servlet.WebApplicationHandler;
    39 import org.mortbay.util.InetAddrPort;
    40 
     40import org.mortbay.jetty.handler.ContextHandlerCollection;
     41import org.mortbay.jetty.handler.DefaultHandler;
     42import org.mortbay.jetty.handler.HandlerCollection;
     43import org.mortbay.jetty.handler.RequestLogHandler;
     44import org.mortbay.jetty.nio.SelectChannelConnector;
     45import org.mortbay.jetty.security.DigestAuthenticator;
     46import org.mortbay.jetty.security.HashUserRealm;
     47import org.mortbay.jetty.security.Constraint;
     48import org.mortbay.jetty.security.ConstraintMapping;
     49import org.mortbay.jetty.security.SecurityHandler;
     50import org.mortbay.jetty.security.SslSelectChannelConnector;
     51import org.mortbay.jetty.servlet.ServletHandler;
     52import org.mortbay.jetty.servlet.ServletHolder;
     53import org.mortbay.jetty.servlet.SessionHandler;
     54import org.mortbay.jetty.webapp.WebAppContext;
     55import org.mortbay.log.Log;
     56import org.mortbay.thread.QueuedThreadPool;
     57import org.mortbay.thread.concurrent.ThreadPool;
     58
     59/**
     60 *  Start the router console.
     61 */
    4162public class RouterConsoleRunner {
    42     private Server _server;
     63    private static Server _server;
    4364    private String _listenPort;
    4465    private String _listenHost;
     
    4667    private String _sslListenHost;
    4768    private String _webAppsDir;
     69
    4870    private static final String PROP_WEBAPP_CONFIG_FILENAME = "router.webappsConfigFile";
    4971    private static final String DEFAULT_WEBAPP_CONFIG_FILENAME = "webapps.config";
     
    6082    private static final String USAGE = "Bad RouterConsoleRunner arguments, check clientApp.0.args in your clients.config file! " +
    6183                                        "Usage: [[port host[,host]] [-s sslPort [host[,host]]] [webAppsDir]]";
     84
     85    private static final int MIN_THREADS = 1;
     86    private static final int MAX_THREADS = 24;
     87    private static final int MAX_IDLE_TIME = 90*1000;
     88    private static final String THREAD_NAME = "RouterConsole Jetty";
    6289   
    6390    static {
     
    138165    }
    139166   
     167    /**
     168     *  SInce _server is now static
     169     *  @return may be null or stopped perhaps
     170     *  @since Jetty 6 since it doesn't have Server.getServers()
     171     */
     172    static Server getConsoleServer() {
     173        return _server;
     174    }
     175
    140176    private static void startTrayApp() {
    141177        try {
     
    161197    }
    162198
     199    /**
     200     *  http://irc.codehaus.org/display/JETTY/Porting+to+jetty6
     201     *
     202     *<pre>
     203     *  Server
     204     *          HandlerCollection
     205     *                  ContextHandlerCollection
     206     *                          WebAppContext (i.e. ContextHandler)
     207     *                                  SessionHandler
     208     *                                  SecurityHandler
     209     *                                  ServletHandler
     210     *                                          servlets...
     211     *                          WebAppContext
     212     *                          ...
     213     *                  DefaultHandler
     214     *                  RequestLogHandler (opt)
     215     *</pre>
     216     */
    163217    public void startConsole() {
    164218        File workDir = new SecureDirectory(I2PAppContext.getGlobalContext().getTempDir(), "jetty-work");
     
    170224            System.err.println("ERROR: Unable to create Jetty temporary work directory");
    171225       
     226        //try {
     227        //    Log.setLog(new I2PLogger(I2PAppContext.getGlobalContext()));
     228        //} catch (Throwable t) {
     229        //    System.err.println("INFO: I2P Jetty logging class not found, logging to wrapper log");
     230        //}
     231        // This way it doesn't try to load Slf4jLog first
     232        System.setProperty("org.mortbay.log.class", "net.i2p.jetty.I2PLogger");
     233
    172234        // so Jetty can find WebAppConfiguration
    173235        System.setProperty("jetty.class.path", I2PAppContext.getGlobalContext().getBaseDir() + "/lib/routerconsole.jar");
    174236        _server = new Server();
     237        _server.setGracefulShutdown(1000);
     238
     239        try {
     240            ThreadPool ctp = new CustomThreadPoolExecutor();
     241            ctp.prestartAllCoreThreads();
     242            _server.setThreadPool(ctp);
     243        } catch (Throwable t) {
     244            // class not found...
     245            System.out.println("INFO: Jetty concurrent ThreadPool unavailable, using QueuedThreadPool");
     246            QueuedThreadPool qtp = new QueuedThreadPool(MAX_THREADS);
     247            qtp.setMinThreads(MIN_THREADS);
     248            qtp.setMaxIdleTimeMs(MAX_IDLE_TIME);
     249            _server.setThreadPool(qtp);
     250        }
     251
     252        HandlerCollection hColl = new HandlerCollection();
     253        ContextHandlerCollection chColl = new ContextHandlerCollection();
     254        _server.addHandler(hColl);
     255        hColl.addHandler(chColl);
     256        hColl.addHandler(new DefaultHandler());
    175257
    176258        String log = I2PAppContext.getGlobalContext().getProperty("routerconsole.log");
     
    180262                logFile = new File(I2PAppContext.getGlobalContext().getLogDir(), "logs/" + log);
    181263            try {
    182                 _server.setRequestLog(new NCSARequestLog(logFile.getAbsolutePath()));
    183             } catch (IOException ioe) {
     264                RequestLogHandler rhl = new RequestLogHandler();
     265                rhl.setRequestLog(new NCSARequestLog(logFile.getAbsolutePath()));
     266                hColl.addHandler(rhl);
     267            } catch (Exception ioe) {
    184268                System.err.println("ERROR: Unable to create Jetty log: " + ioe);
    185269            }
     
    204288            _webAppsDir += '/';
    205289
    206         List<String> notStarted = new ArrayList();
    207         WebApplicationHandler baseHandler = null;
     290        WebAppContext rootWebApp = null;
     291        ServletHandler rootServletHandler = null;
    208292        try {
    209293            int boundAddresses = 0;
     
    220304                        //else
    221305                        //    _server.addListener(host + ':' + _listenPort);
    222                         InetAddrPort iap = new InetAddrPort(host, lport);
    223                         SocketListener lsnr = new SocketListener(iap);
    224                         lsnr.setMinThreads(1);           // default 2
    225                         lsnr.setMaxThreads(24);          // default 256
    226                         lsnr.setMaxIdleTimeMs(90*1000);  // default 10 sec
     306                        // Use AbstractConnector instead of Connector so we can do setName()
     307                        AbstractConnector lsnr = new SelectChannelConnector();
     308                        lsnr.setHost(host);
     309                        lsnr.setPort(lport);
     310                        lsnr.setMaxIdleTime(90*1000);  // default 10 sec
    227311                        lsnr.setName("ConsoleSocket");   // all with same name will use the same thread pool
    228                         _server.addListener(lsnr);
     312                        _server.addConnector(lsnr);
    229313                        boundAddresses++;
    230314                    } catch (NumberFormatException nfe) {
    231315                        System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ' ' + nfe);
    232                     } catch (IOException ioe) { // this doesn't seem to work, exceptions don't happen until start() below
     316                    } catch (Exception ioe) { // this doesn't seem to work, exceptions don't happen until start() below
    233317                        System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ' ' + ioe);
    234318                    }
     
    255339                        String host = tok.nextToken().trim();
    256340                        // doing it this way means we don't have to escape an IPv6 host with []
    257                         InetAddrPort iap = new InetAddrPort(host, sslPort);
    258341                        try {
    259                             SslListener ssll = new SslListener(iap);
     342                            // TODO if class not found use SslChannelConnector
     343                            // Sadly there's no common base class with the ssl methods in it
     344                            SslSelectChannelConnector ssll = new SslSelectChannelConnector();
     345                            ssll.setHost(host);
     346                            ssll.setPort(sslPort);
    260347                            // the keystore path and password
    261348                            ssll.setKeystore(keyStore.getAbsolutePath());
     
    263350                            // the X.509 cert password (if not present, verifyKeyStore() returned false)
    264351                            ssll.setKeyPassword(ctx.getProperty(PROP_KEY_PASSWORD, "thisWontWork"));
    265                             ssll.setMinThreads(1);           // default 2
    266                             ssll.setMaxThreads(24);          // default 256
    267                             ssll.setMaxIdleTimeMs(90*1000);  // default 10 sec
     352                            ssll.setMaxIdleTime(90*1000);  // default 10 sec
    268353                            ssll.setName("ConsoleSocket");   // all with same name will use the same thread pool
    269                             _server.addListener(ssll);
     354                            _server.addConnector(ssll);
    270355                            boundAddresses++;
    271356                        } catch (Exception e) {   // probably no exceptions at this point
     
    283368                return;
    284369            }
    285             _server.setRootWebApp(ROUTERCONSOLE);
    286             WebApplicationContext wac = _server.addWebApplication("/", _webAppsDir + ROUTERCONSOLE + ".war");
     370
     371            rootWebApp = new LocaleWebAppHandler(I2PAppContext.getGlobalContext(),
     372                                                  "/", _webAppsDir + ROUTERCONSOLE + ".war");
    287373            File tmpdir = new SecureDirectory(workDir, ROUTERCONSOLE + "-" +
    288374                                                       (_listenPort != null ? _listenPort : _sslListenPort));
    289375            tmpdir.mkdir();
    290             wac.setTempDirectory(tmpdir);
    291             baseHandler = new LocaleWebAppHandler(I2PAppContext.getGlobalContext());
    292             wac.addHandler(0, baseHandler);
    293             initialize(wac);
    294             File dir = new File(_webAppsDir);
    295             String fileNames[] = dir.list(WarFilenameFilter.instance());
    296             if (fileNames != null) {
    297                 for (int i = 0; i < fileNames.length; i++) {
    298                     try {
    299                         String appName = fileNames[i].substring(0, fileNames[i].lastIndexOf(".war"));
    300                         String enabled = props.getProperty(PREFIX + appName + ENABLED);
    301                         if (! "false".equals(enabled)) {
    302                             String path = new File(dir, fileNames[i]).getCanonicalPath();
    303                             tmpdir = new SecureDirectory(workDir, appName + "-" +
    304                                                                   (_listenPort != null ? _listenPort : _sslListenPort));
    305                             WebAppStarter.addWebApp(I2PAppContext.getGlobalContext(), _server, appName, path, tmpdir);
    306 
    307                             if (enabled == null) {
    308                                 // do this so configclients.jsp knows about all apps from reading the config
    309                                 props.setProperty(PREFIX + appName + ENABLED, "true");
    310                                 rewrite = true;
    311                             }
    312                         } else {
    313                             notStarted.add(appName);
    314                         }
    315                     } catch (IOException ioe) {
    316                         System.err.println("Error resolving '" + fileNames[i] + "' in '" + dir);
    317                     }
    318                 }
    319             }
    320         } catch (IOException ioe) {
     376            rootWebApp.setTempDirectory(tmpdir);
     377            rootWebApp.setSessionHandler(new SessionHandler());
     378            rootServletHandler = new ServletHandler();
     379            rootWebApp.setServletHandler(rootServletHandler);
     380            initialize(rootWebApp);
     381            chColl.addHandler(rootWebApp);
     382
     383        } catch (Exception ioe) {
    321384            ioe.printStackTrace();
    322385        }
    323         if (rewrite)
    324             storeWebAppProperties(props);
     386
    325387        try {
     388            // start does a mapContexts()
    326389            _server.start();
    327390        } catch (Throwable me) {
     
    336399        }
    337400
    338         if (baseHandler != null) {
     401        // Start all the other webapps after the server is up,
     402        // so things start faster.
     403        // Jetty 6 starts the connector before the router console is ready
     404        // This also prevents one webapp from breaking the whole thing
     405        List<String> notStarted = new ArrayList();
     406        if (_server.isRunning()) {
     407            File dir = new File(_webAppsDir);
     408            String fileNames[] = dir.list(WarFilenameFilter.instance());
     409            if (fileNames != null) {
     410                for (int i = 0; i < fileNames.length; i++) {
     411                    String appName = fileNames[i].substring(0, fileNames[i].lastIndexOf(".war"));
     412                    String enabled = props.getProperty(PREFIX + appName + ENABLED);
     413                    if (! "false".equals(enabled)) {
     414                        try {
     415                            String path = new File(dir, fileNames[i]).getCanonicalPath();
     416                            WebAppStarter.startWebApp(I2PAppContext.getGlobalContext(), chColl, appName, path);
     417                            if (enabled == null) {
     418                                // do this so configclients.jsp knows about all apps from reading the config
     419                                props.setProperty(PREFIX + appName + ENABLED, "true");
     420                                rewrite = true;
     421                            }
     422                        } catch (Throwable t) {
     423                            System.err.println("ERROR: Failed to start " + appName + ' ' + t);
     424                            t.printStackTrace();
     425                            notStarted.add(appName);
     426                        }
     427                    } else {
     428                        notStarted.add(appName);
     429                    }
     430                }
     431            }
     432        } else {
     433            System.err.println("ERROR: Router console did not start, not starting webapps");
     434        }
     435
     436        if (rewrite)
     437            storeWebAppProperties(props);
     438
     439        if (rootServletHandler != null && notStarted.size() > 0) {
    339440            // map each not-started webapp to the error page
     441            ServletHolder noWebApp = rootServletHandler.getServlet("net.i2p.router.web.jsp.nowebapp_jsp");
    340442            for (int i = 0; i < notStarted.size(); i++) {
     443                // we want a new handler for each one since if the webapp is started we remove the handler???
    341444                try {
    342                      baseHandler.mapPathToServlet('/' + notStarted.get(i) + "/*",
    343                                                   "net.i2p.router.web.jsp.nowebapp_jsp");
     445                    if (noWebApp != null) {
     446                        String path = '/' + notStarted.get(i);
     447                        // LocaleWebAppsHandler adds a .jsp
     448                        rootServletHandler.addServletWithMapping(noWebApp, path + ".jsp");
     449                        rootServletHandler.addServletWithMapping(noWebApp, path + "/*");
     450                    } else {
     451                        System.err.println("Can't find nowebapp.jsp?");
     452                    }
    344453                } catch (Throwable me) {
    345454                     System.err.println(me);
     455                     me.printStackTrace();
    346456                }
    347457            }
     
    459569    }
    460570
    461     static void initialize(WebApplicationContext context) {
     571    static void initialize(WebAppContext context) {
     572        SecurityHandler sec = new SecurityHandler();
     573        List<ConstraintMapping> constraints = new ArrayList(4);
    462574        String password = getPassword();
    463575        if (password != null) {
     
    465577            realm.put("admin", password);
    466578            realm.addUserToRole("admin", "routerAdmin");
    467             context.setRealm(realm);
    468             context.setAuthenticator(authenticator);
    469             context.addHandler(0, new SecurityHandler());
    470             SecurityConstraint constraint = new SecurityConstraint("admin", "routerAdmin");
     579            sec.setUserRealm(realm);
     580            sec.setAuthenticator(authenticator);
     581            Constraint constraint = new Constraint("admin", "routerAdmin");
    471582            constraint.setAuthenticate(true);
    472             context.addSecurityConstraint("/", constraint);
     583            ConstraintMapping cm = new ConstraintMapping();
     584            cm.setConstraint(constraint);
     585            cm.setPathSpec("/");
     586            constraints.add(cm);
    473587        }
    474588
     
    482596        // See also:
    483597        // http://old.nabble.com/Disable-HTTP-TRACE-in-Jetty-5.x-td12412607.html
    484         SecurityConstraint sc = new SecurityConstraint();
    485         sc.setName("No trace or options");
    486         sc.addMethod("TRACE");
    487         sc.addMethod("OPTIONS");
    488         sc.setAuthenticate(true);
    489         context.addSecurityConstraint("/*", sc) ;
     598
     599        Constraint sc = new Constraint();
     600        sc.setName("No trace");
     601        ConstraintMapping cm = new ConstraintMapping();
     602        cm.setMethod("TRACE");
     603        cm.setConstraint(sc);
     604        cm.setPathSpec("/");
     605        constraints.add(cm);
     606
     607        sc = new Constraint();
     608        sc.setName("No options");
     609        cm = new ConstraintMapping();
     610        cm.setMethod("OPTIONS");
     611        cm.setConstraint(sc);
     612        cm.setPathSpec("/");
     613        constraints.add(cm);
     614
     615        ConstraintMapping cmarr[] = constraints.toArray(new ConstraintMapping[constraints.size()]);
     616        sec.setConstraintMappings(cmarr);
     617
     618        context.setSecurityHandler(sec);
    490619    }
    491620   
     
    512641   
    513642    /** @since 0.8.8 */
    514     private class ServerShutdown implements Runnable {
     643    private static class ServerShutdown implements Runnable {
    515644        public void run() {
    516645            try {
    517646                _server.stop();
    518             } catch (InterruptedException ie) {}
     647            } catch (Exception ie) {}
    519648        }
    520649    }
     
    575704    }
    576705
     706   
     707    /**
     708     * Just to set the name and set Daemon
     709     * @since Jetty 6
     710     */
     711    private static class CustomThreadPoolExecutor extends ThreadPool {
     712        public CustomThreadPoolExecutor() {
     713             super(MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS,
     714                   new SynchronousQueue(), new CustomThreadFactory(),
     715                   new ThreadPoolExecutor.CallerRunsPolicy());
     716        }
     717    }
     718
     719    /**
     720     * Just to set the name and set Daemon
     721     * @since Jetty 6
     722     */
     723    private static class CustomThreadFactory implements ThreadFactory {
     724
     725        public Thread newThread(Runnable r) {
     726            Thread rv = Executors.defaultThreadFactory().newThread(r);
     727            rv.setName(THREAD_NAME);
     728            rv.setDaemon(true);
     729            return rv;
     730        }
     731    }
     732
    577733}
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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
    1718<jsp:useBean class="net.i2p.router.web.ConfigClientsHelper" id="clientshelper" scope="request" />
    18 <jsp:setProperty name="clientshelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    19 <jsp:setProperty name="clientshelper" property="edit" value="<%=request.getParameter("edit")%>" />
     19<jsp:setProperty name="clientshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     20<jsp:setProperty name="clientshelper" property="edit" value="<%=request.getParameter(\"edit\")%>" />
    2021<h1><%=intl._("I2P Client Configuration")%></h1>
    2122<div class="main" id="main">
     
    2425 <jsp:useBean class="net.i2p.router.web.ConfigClientsHandler" id="formhandler" scope="request" />
    2526 <% formhandler.storeMethod(request.getMethod()); %>
    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")%>" />
     27 <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
     28 <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter(\"action\")%>" />
     29 <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter(\"nonce\")%>" />
    2930 <jsp:setProperty name="formhandler" property="settings" value="<%=request.getParameterMap()%>" />
    3031 <jsp:getProperty name="formhandler" property="allMessages" />
  • apps/routerconsole/jsp/configkeyring.jsp

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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" />
    22         <pathelement location="${lib}/ant.jar" />
     23        <pathelement location="${ant.home}/lib/ant.jar" />
    2324        <pathelement location="../../../core/java/build/i2p.jar" />
    2425        </path>
  • apps/susidns/src/jsp/addressbook.jsp

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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" />
     
    5253        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
    5354        <echo message="  debianhowto: instructions on building Debian packages" />
    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)" /> -->
     55        <echo message="  debian: generate Debian packages in ../" />
     56        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
     57        <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)" />
     58        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
    5859        <echo message="  poupdate: update the .po files for translators" />
    5960        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
    6061   </target>
    6162    <target name="debianhowto">
    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 both the Build-Depends and Build-Depends-Indep fields."/>
    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 dependencies for you:" />
    70             <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential quilt" />
    71             <echo message=" " />
    72             <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
    73             <echo message="to patch the source and build the packages." />
     63            <echo message="To build debian packages, you must make sure that you have" />
     64            <echo message="the necessary build-dependencies installed." />
     65            <echo message="The packages required to build can be found in the file "/>
     66            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
     67            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
     68            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
     69            <echo message="" />
     70            <echo message="The following command will install all of the dependencies for you:" />
     71            <echo message=" " />
     72            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential \" />
     73            <echo message="                   quilt libcommons-el-java libcommons-logging-java libjetty-extra-java libjetty-java" />
     74            <echo message=" " />
     75            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
     76            <echo message="to patch the source and build the packages." />
    7477    </target>
    7578    <target name="dist" depends="pkg, javadoc">
     
    134137    </target>
    135138
    136     <target name="buildJetty" depends="buildProperties" >
     139    <target name="buildJetty" depends="buildCore" >
    137140        <ant dir="apps/jetty" target="build" />
    138141    </target>
     
    199202        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
    200203        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
    201         <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
    202         <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
    203         <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
    204         <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
    205         <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
    206         <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
     204        <copy todir="build/" >
     205            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
     206        </copy>
    207207    </target>
    208208
     
    405405            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
    406406            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
    407             <group title="SAM Bridge" packages="net.i2p.sam" />
    408             <group title="SAM Demos" packages="net.i2p.sam.client" />
     407            <group title="Jetty Logging" packages="net.i2p.jetty" />
     408            <group title="SAM Bridge" packages="net.i2p.sam:net.i2p.sam.client" />
    409409            <group title="SusiDNS Application" packages="i2p.susi.dns" />
    410             <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
     410            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util:org.mortbay.servlet:org.mortbay.util" />
    411411            <group title="Systray Application" packages="net.i2p.apps.systray" />
    412412            <sourcepath>
     
    427427                <pathelement location="apps/susidns/src/java/src" />
    428428                <pathelement location="apps/susimail/src/src" />
     429                <pathelement location="apps/jetty/java/src" />
    429430            </sourcepath>
    430431            <classpath>
    431432                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
    432433                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
     434                <pathelement location="apps/jetty/jettylib/jetty-sslengine.jar" />
     435                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
     436                <pathelement location="apps/jetty/jettylib/jetty-java5-threadpool.jar" />
     437                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
     438                <pathelement location="apps/jetty/jettylib/jsp-api.jar" />
    433439                <pathelement location="apps/systray/java/lib/systray4j.jar" />
    434440                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
     
    636642    </target>
    637643
     644    <target name="webappDistclean">
     645        <ant dir="apps/i2ptunnel/java/" target="distclean" />
     646        <ant dir="apps/routerconsole/java/" target="distclean" />
     647        <ant dir="apps/addressbook/" target="distclean" />
     648        <ant dir="apps/susimail/" target="distclean" />
     649        <ant dir="apps/susidns/src/" target="distclean" />
     650        <ant dir="apps/i2psnark/java/" target="distclean" />
     651    </target>
     652
    638653    <target name="pkg" depends="distclean, updater, preppkg, installer" />
    639654
     
    764779        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
    765780        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
    766         <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
    767         <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
    768         <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
    769         <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
    770         <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
     781        <!-- all jetty stuff -->
     782        <copy todir="pkg-temp/lib" >
     783            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
     784        </copy>
    771785        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
    772786        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
    773         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    774787        <copy file="build/router.jar" todir="pkg-temp/lib/" />
    775788        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
     
    818831        <!-- Eepsite stuff here -->
    819832        <mkdir dir="pkg-temp/eepsite" />
    820         <mkdir dir="pkg-temp/eepsite/webapps" />
    821         <mkdir dir="pkg-temp/eepsite/logs" />
    822         <mkdir dir="pkg-temp/eepsite/cgi-bin" />
    823         <mkdir dir="pkg-temp/eepsite/docroot" />
    824         <mkdir dir="pkg-temp/eepsite/docroot/help" />
    825         <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
    826         <copy todir="pkg-temp/eepsite/docroot/" >
    827             <fileset dir="installer/resources/eepsite.help/" />
     833        <copy todir="pkg-temp/eepsite/" >
     834            <fileset dir="installer/resources/eepsite/" />
    828835        </copy>
    829836        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
     
    831838        </copy>
    832839        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
    833         <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
    834840    </target>
    835841
     
    845851         -->
    846852        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
     853        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
    847854        <!--  Not sure if these are used or should be included -->
    848855        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
     
    913920    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
    914921    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
     922    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
    915923    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
    916924    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
     
    10521060    </target>
    10531061
     1062    <!-- All jetty jars required for update.
     1063         We don't need commons-el or commons-logging, they haven't changed.
     1064         TODO do we need to bother updating jasper?
     1065         TODO where is JMX? We don't need it I hope.
     1066      -->
    10541067    <target name="prepjupdate" depends="prepupdate, buildWEB">
    1055         <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
    1056         <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
    1057         <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
    1058         <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
    1059         <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
    1060         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    1061     </target>
     1068        <copy todir="pkg-temp/lib" >
     1069            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
     1070        </copy>
     1071        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
     1072              can't overwrite an existing eepsite dir in a non-split configuration.
     1073          -->
     1074        <copy todir="pkg-temp/eepsite-jetty6" >
     1075            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
     1076        </copy>
     1077    </target>
     1078
     1079    <!-- Jetty 6 I2P logging addons, not really fixes -->
    10621080    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
    1063         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
     1081        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
    10641082    </target>
    10651083
     
    14931511    <target name="debian-binary" >
    14941512        <echo message="Did you update the version using dch -i?" />
    1495         <echo message=" " />
    1496         <echo message="If the changelog was not updated with dch -i, press" />
    1497         <echo message="press CTRL+C to abort building this Debian package." />
    1498         <echo message="" />
    1499         <echo message="Pausing build for ten seconds to give enough time to read this notice." />
    1500         <exec executable="sleep" failonerror="true">
    1501                 <arg value="10" />
    1502         </exec>
     1513        <echo message=" " />
     1514        <echo message="If the changelog was not updated with dch -i, press" />
     1515        <echo message="press CTRL+C to abort building this Debian package." />
     1516        <echo message="" />
     1517        <echo message="Pausing build for ten seconds to give enough time to read this notice." />
     1518        <exec executable="sleep" failonerror="true">
     1519                <arg value="10" />
     1520        </exec>
    15031521        <echo message="====================" />
    1504         <!-- bundle the jetty 5 lib since there isn't a deb for it -->
    1505         <ant dir="apps/jetty" target="ensureJettylib" />
    1506        
    1507         <exec executable="fakeroot" failonerror="true">
    1508             <arg value="debian/rules" />
    1509             <arg value="patch" />
    1510             <arg value="binary" />
    1511             <arg value="clean" />
    1512         </exec>
    1513         <delete dir=".pc" />
    1514     </target>
     1522
     1523        <exec executable="fakeroot" failonerror="true">
     1524            <arg value="debian/rules" />
     1525            <arg value="patch" />
     1526            <arg value="binary" />
     1527            <arg value="clean" />
     1528        </exec>
     1529        <delete dir=".pc" />
     1530    </target>
     1531
    15151532    <target name="debian-clean" depends="buildProperties" >
    15161533        <exec executable="fakeroot" failonerror="true">
    1517             <arg value="debian/rules" />
    1518             <arg value="clean" />
    1519         </exec>
    1520         <delete dir="./.pc" />
    1521     </target>
     1534            <arg value="debian/rules" />
     1535            <arg value="clean" />
     1536        </exec>
     1537        <delete dir="./.pc" />
     1538    </target>
     1539
    15221540    <target name="debian-patch" depends="buildProperties" >
    15231541        <exec executable="quilt" failonerror="true">
     
    15291547    <target name="debian-unpatch" depends="buildProperties">
    15301548        <exec executable="quilt" failonerror="false">
    1531             <arg value="-a" />
    1532             <arg value="pop" />
     1549            <arg value="-a" />
     1550            <arg value="pop" />
    15331551        </exec>
    15341552    </target>
  • debian/control

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
     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

    rd93805e r6107e38  
    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

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

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    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"
     49## To use local or remote JMX, edit jetty-jmx.xml and use:
     50#clientApp.3.args="/path/to/jetty.xml" "/path/to/jetty-jmx.xml"
    4551clientApp.3.args="eepsite/jetty.xml"
    4652clientApp.3.delay=30
  • router/java/src/net/i2p/router/Router.java

    rd93805e r6107e38  
    14211421            // Ideally, do not use I2P classes at all, new or not.
    14221422            try {
    1423                 // TODO move deleteListedFiles() here after a few releases
    1424                 if (ok)
     1423                if (ok) {
     1424                    // We do this here so we may delete old jars before we restart
     1425                    deleteListedFiles();
    14251426                    System.out.println("INFO: Update installed");
    1426                 else
     1427                } else {
    14271428                    System.out.println("ERROR: Update failed!");
     1429                }
    14281430                if (!ok) {
    14291431                    // we can't leave the file in place or we'll continually restart, so rename it
     
    14561458        } else {
    14571459            deleteJbigiFiles();
    1458             // Here so it may be used in the 0.8.12 update
    1459             // TODO move up in a few releases so it is only run after an update
     1460            // It was here starting in 0.8.12 so it could be used the very first time
     1461            // Now moved up so it is usually run only after an update
     1462            // But the first time before jetty 6 it will run here...
     1463            // Here we can't remove jars
    14601464            deleteListedFiles();
    14611465        }
  • router/java/src/net/i2p/router/startup/ClientAppConfig.java

    rd93805e r6107e38  
    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

    rd93805e r6107e38  
    164164        boolean success = migrate(MIGRATE_BASE, oldDirf, dirf);
    165165        // this one must be after MIGRATE_BASE
    166         success &= migrateJettyXml(oldDirf, dirf);
     166        File oldEep = new File(oldDirf, "eepsite");
     167        File newEep = new File(dirf, "eepsite");
     168        String newPath = newEep.getAbsolutePath() + File.separatorChar;
     169        success &= migrateJettyXml(oldEep, newEep, "jetty.xml", "./eepsite/", newPath);
     170        success &= migrateJettyXml(oldEep, newEep, "jetty-ssl.xml", "./eepsite/", newPath);
     171        success &= migrateJettyXml(oldEep, newEep, "contexts/base-context.xml", "./eepsite/", newPath);
     172        success &= migrateJettyXml(oldEep, newEep, "contexts/cgi-context.xml", "./eepsite/", newPath);
    167173        success &= migrateClientsConfig(oldDirf, dirf);
    168174        // for later news.xml updates (we don't copy initialNews.xml over anymore)
     
    296302                out.println(s);
    297303            }
    298             System.err.println("Copied clients.config with modifications");
     304            System.err.println("Copied " + oldFile + " with modifications");
    299305            return true;
    300306        } catch (IOException ioe) {
    301307            if (in != null) {
    302                 System.err.println("FAILED copy clients.config");
     308                System.err.println("FAILED copy " + oldFile + ": " + ioe);
    303309                return false;
    304310            }
     
    315321     *  do it again with modifications.
    316322     */
    317     private static boolean migrateJettyXml(File olddir, File todir) {
    318         File eepsite1 = new File(olddir, "eepsite");
    319         File oldFile = new File(eepsite1, "jetty.xml");
    320         File eepsite2 = new File(todir, "eepsite");
    321         File newFile = new File(eepsite2, "jetty.xml");
     323    static boolean migrateJettyXml(File olddir, File todir, String filename, String oldString, String newString) {
     324        File oldFile = new File(olddir, filename);
     325        File newFile = new File(todir, filename);
    322326        FileInputStream in = null;
    323327        PrintWriter out = null;
     
    327331            String s = null;
    328332            while ((s = DataHelper.readLine(in)) != null) {
    329                 if (s.indexOf("./eepsite/") >= 0) {
    330                     s = s.replace("./eepsite/", todir.getAbsolutePath() + File.separatorChar + "eepsite" + File.separatorChar);
     333                if (s.indexOf(oldString) >= 0) {
     334                    s = s.replace(oldString, newString);
    331335                }
    332336                out.println(s);
    333337            }
    334338            out.println("<!-- Modified by I2P User dir migration script -->");
    335             System.err.println("Copied jetty.xml with modifications");
     339            System.err.println("Copied " + oldFile + " with modifications");
    336340            return true;
    337341        } catch (IOException ioe) {
    338342            if (in != null) {
    339                 System.err.println("FAILED copy jetty.xml");
     343                System.err.println("FAILED copy " + oldFile + ": " + ioe);
    340344                return false;
    341345            }
     
    393397     * @return true if it was copied successfully
    394398     */
    395     private static boolean copyFile(File src, File dst) {
     399    static boolean copyFile(File src, File dst) {
    396400        if (!src.exists()) return false;
    397401        boolean rv = true;
     
    410414            System.err.println("Copied " + src.getPath());
    411415        } catch (IOException ioe) {
    412             System.err.println("FAILED copy " + src.getPath());
     416            System.err.println("FAILED copy " + src.getPath() + ": " + ioe);
    413417            rv = false;
    414418        } finally {
Note: See TracChangeset for help on using the changeset viewer.