Changes in / [140ffc5:2b81cee]


Ignore:
Files:
49 added
29 deleted
80 edited

Legend:

Unmodified
Added
Removed
  • LICENSE.txt

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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") ||
     
    107106            return super.getResource(pathInContext);
    108107        // files in the i2psnark/ directory
    109         return _resourceBase.addPath(pathInContext);
     108        try {
     109            return _resourceBase.addPath(pathInContext);
     110        } catch (IOException ioe) {
     111            throw new RuntimeException(ioe);
     112        }
    110113    }
    111114
     
    115118     */
    116119    @Override
    117     public void handleGet(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource, boolean endsWithSlash) throws ServletException, IOException {
    118         if (resource.getName().startsWith("jar:file:"))
    119             response.setHeader("Cache-Control", "max-age=86400");  // cache for a day
    120         super.handleGet(request, response, pathInContext, resource, endsWithSlash);
     120    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     121////////////////////////////////////
     122        //if (resource.getName().startsWith("jar:file:"))
     123        //    response.setHeader("Cache-Control", "max-age=86400");  // cache for a day
     124        super.doGet(request, response);
    121125    }
    122126
     
    146150        String method = req.getMethod();
    147151        if (!(method.equals("GET") || method.equals("HEAD") || method.equals("POST"))) {
    148             resp.sendError(HttpResponse.__405_Method_Not_Allowed);
     152            resp.sendError(405);
    149153            return;
    150154        }
     
    172176                // bypass the horrid Resource.getListHTML()
    173177                String pathInfo = req.getPathInfo();
    174                 String pathInContext = URI.addPaths(path, pathInfo);
     178                String pathInContext = URIUtil.addPaths(path, pathInfo);
    175179                req.setCharacterEncoding("UTF-8");
    176180                resp.setCharacterEncoding("UTF-8");
     
    178182                Resource resource = getResource(pathInContext);
    179183                if (resource == null || (!resource.exists())) {
    180                     resp.sendError(HttpResponse.__404_Not_Found);
     184                    resp.sendError(404);
    181185                } else {
    182                     String base = URI.addPaths(req.getRequestURI(), "/");
     186                    String base = URIUtil.addPaths(req.getRequestURI(), "/");
    183187                    String listing = getListHTML(resource, base, true, method.equals("POST") ? req.getParameterMap() : null);
    184188                    if (listing != null)
    185189                        resp.getWriter().write(listing);
    186190                    else // shouldn't happen
    187                         resp.sendError(HttpResponse.__404_Not_Found);
     191                        resp.sendError(404);
    188192                }
    189193            } else {
     
    18471851        StringBuilder buf=new StringBuilder(4096);
    18481852        buf.append(DOCTYPE + "<HTML><HEAD><TITLE>");
    1849         String title = URI.decodePath(base);
     1853        String title = URIUtil.decodePath(base);
    18501854        if (title.startsWith("/i2psnark/"))
    18511855            title = title.substring("/i2psnark/".length());
     
    19561960        buf.append("</tr></thead>\n");
    19571961        buf.append("<tr><td colspan=\"" + (showPriority ? '4' : '3') + "\" class=\"ParentDir\"><A HREF=\"");
    1958         buf.append(URI.addPaths(base,"../"));
     1962        buf.append(URIUtil.addPaths(base,"../"));
    19591963        buf.append("\"><img alt=\"\" border=\"0\" src=\"" + _imgPath + "up.png\"> ")
    19601964            .append(_("Up to higher level directory")).append("</A></td></tr>\n");
     
    19661970        for (int i=0 ; i< ls.length ; i++)
    19671971        {   
    1968             String encoded=URI.encodePath(ls[i]);
     1972            String encoded=URIUtil.encodePath(ls[i]);
    19691973            // bugfix for I2P - Backport from Jetty 6 (zero file lengths and last-modified times)
    19701974            // http://jira.codehaus.org/browse/JETTY-361?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel#issue-tabs
     
    20222026            }
    20232027
    2024             String path=URI.addPaths(base,encoded);
     2028            String path=URIUtil.addPaths(base,encoded);
    20252029            if (item.isDirectory() && !path.endsWith("/"))
    2026                 path=URI.addPaths(path,"/");
     2030                path=URIUtil.addPaths(path,"/");
    20272031            String icon = toIcon(item);
    20282032
  • apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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" />
     
    7068            </manifest>
    7169        </jar>
     70        <jar destfile="./build/temp-beans.jar" basedir="./build/obj" includes="**/EditBean.class **/IndexBean.class" />
    7271    </target>
    7372
     
    131130    </target>
    132131
     132    <!-- The web classes are now in the war not the jar - they are not part of the API -->
    133133    <target name="war" depends="precompilejsp, bundle, warUpToDate, listChangedFiles2" unless="war.uptodate" >
    134134        <!-- set if unset -->
    135135        <property name="workspace.changes.w.tr" value="" />
     136        <copy file="build/obj/net/i2p/i2ptunnel/web/EditBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
     137        <copy file="build/obj/net/i2p/i2ptunnel/web/IndexBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
    136138        <war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
    137139             basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
     
    174176                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    175177                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    176                 <pathelement location="../../jetty/jettylib/ant.jar" />
     178                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     179                <pathelement location="${ant.home}/lib/ant.jar" />
    177180                <pathelement location="build/i2ptunnel.jar" />
     181                <pathelement location="build/temp-beans.jar" />
    178182            </classpath>
    179183            <arg value="-d" />
    180184            <arg value="../jsp/WEB-INF/classes" />
     185            <arg value="-v" />
    181186            <arg value="-p" />
    182187            <arg value="net.i2p.i2ptunnel.jsp" />
     
    195200                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    196201                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     202                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    197203                <pathelement location="build/i2ptunnel.jar" />
     204                <pathelement location="build/temp-beans.jar" />
    198205            </classpath>
    199206        </javac>
  • apps/i2ptunnel/jsp/edit.jsp

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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" />
    1214
     15  <!--
    1316    <target name="ensureJettylib" >
    1417        <available property="jetty.zip.available" file="${jetty.filename}" type="file" />
     
    1821        <ant target="extractJettylib" />
    1922    </target>
     23   -->
     24    <target name="ensureJettylib" depends="extractJettylib" />
    2025
    2126    <target name="fetchJettylib" unless="jetty.zip.available" >
     
    6469    </target>
    6570
     71  <!--
    6672    <target name="extractJettylib" unless="jetty.zip.extracted" >
     73   -->
     74    <target name="extractJettylib" >
     75      <!-- for .tgz -->
     76      <!--
    6777        <gunzip src="${jetty.filename}" dest="jetty.tar" />
    6878        <untar src="jetty.tar" dest="." />
     79      -->
     80      <!-- for .zip -->
     81      <!--
     82        <unzip src="${jetty.filename}" dest="." />
     83      -->
    6984        <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>
     85      <!-- We copy everything to names without the version numbers so we
     86           can update them later. Where there was something similar in Jetty 5,
     87           we use the same names so they will overwrite the Jetty 5 jar on upgrade.
     88           Otherwise we use the same name as the symlink in Ubuntu /usr/share/java.
     89           Reasons for inclusion:
     90              start.jar: Needed for clients.config startup of eepsites
     91              jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
     92              jetty-sslengine-xxx.jar: SSL NIO Connector for console
     93              jetty-java5-threadpool-xxx.jar: Concurrent thread pool for eepsite
     94              glassfish 2.1: Not used, too old, see Tomcat below.
     95              jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
     96              jetty-management: Not used by I2P, but only 34KB and could be useful for eepsites, and we bundled it with Jetty 5
     97              All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
     98        -->
     99        <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
     100        <copy file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
     101        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
     102        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" />
     103        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
     104        <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" />
     105        <copy preservelastmodified="true" file="${jetty.base}/lib/management/jetty-management-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
    82106        <delete file="jetty.tar" />
     107      <!--
    83108        <delete dir="${jetty.base}" />
     109      -->
     110        <!-- commons-logging.jar not in Jetty 6 but we have it in launch4j so copy it over, we need it
     111             for org.apache.jasper.JspC compiler
     112          -->
     113        <copy preservelastmodified="true" file="../../installer/lib/launch4j/lib/commons-logging.jar" todir="jettylib/" />
     114        <ant target="copyTomcatLib" />
     115    </target>
     116
     117    <!-- Tomcat.
     118         The glassfish jars bundled in Jetty 6 are way too old.
     119         For compatibility with very old I2P installations where the classpath
     120         was set individually in wrapper.config, we rename and combine the jars as follows:
     121         jasper.jar : jasper-runtime.jar
     122         jasper-el.jar + el-api.jar : commons-el.jar
     123         servlet-api.jar + jsp-api.jar : javax.servlet.jar
     124         tomcat-juli.jar : commons-logging.jar
     125         empty jar : jasper-compiler.jar
     126         Also, take NOTICE and LICENSE out of each one, we bundle those separately.
     127     -->
     128    <target name="copyTomcatLib" >
     129        <jar destfile="jettylib/jasper-runtime.jar" >
     130            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper.jar" />
     131        </jar>
     132        <jar destfile="jettylib/commons-el.jar" duplicate="preserve" >
     133            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper-el.jar" />
     134            <zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/el-api.jar" />
     135        </jar>
     136        <jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" >
     137            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/servlet-api.jar" />
     138            <zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/jsp-api.jar" />
     139        </jar>
     140        <jar destfile="jettylib/commons-logging.jar" >
     141            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-juli.jar" />
     142        </jar>
     143        <jar destfile="jettylib/jasper-compiler.jar" />
    84144    </target>
    85145
    86146    <target name="build" depends="jar" />
     147
    87148    <target name="builddep" />
    88149    <target name="compile" depends="builddep, ensureJettylib" >
     
    94155            destdir="./build/obj"
    95156            includeAntRuntime="false"
    96             classpath="./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar" >
     157            classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-util.jar" >
    97158            <compilerarg line="${javac.compilerargs}" />
    98159        </javac>
     
    113174    </target>
    114175
     176    <!-- With Jetty 5 we replaced classes in the jar, but with Jetty 6 we
     177         put our stuff in its own jar so we can work with standard Jetty 6 packages
     178      -->
    115179    <target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
    116180        <!-- set if unset -->
    117181        <property name="workspace.changes.tr" value="" />
    118         <jar destfile="./jettylib/org.mortbay.jetty.jar" basedir="./build/obj" includes="**/*.class" update="true" >
     182        <copy todir="build/obj" file="resources/log4j.properties" />
     183        <jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
    119184            <manifest>
    120185                <attribute name="Built-By" value="${build.built-by}" />
     
    127192
    128193    <target name="jarUpToDate">
    129         <uptodate property="jar.uptodate" targetfile="jettylib/org.mortbay.jetty.jar" >
     194        <uptodate property="jar.uptodate" targetfile="jettylib/jetty-i2p.jar" >
    130195            <srcfiles dir= "build/obj" includes="**/*.class" />
    131196        </uptodate>
     
    147212    <target name="distclean" depends="clean">
    148213        <delete dir="./jettylib" />
     214      <!--
    149215        <echo message="Not actually deleting the jetty libs (since they're so large)" />
     216       -->
    150217    </target>
    151218    <target name="reallyclean" depends="distclean">
  • apps/routerconsole/java/build.xml

    r140ffc5 r2b81cee  
    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" />
     
    239249                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    240250                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    241                 <pathelement location="../../jetty/jettylib/ant.jar" />
     251                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     252                <pathelement location="${ant.home}/lib/ant.jar" />
     253                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    242254                <pathelement location="../../systray/java/build/obj" />
    243255                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    272284                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    273285                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     286                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     287                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     288                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
     289                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     290                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    274291                <pathelement location="../../systray/java/build/obj" />
    275292                <pathelement location="../../systray/java/lib/systray4j.jar" />
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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/console.jsp

    r140ffc5 r2b81cee  
    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">
     
    6263 <jsp:setProperty name="contenthelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
    6364 <jsp:setProperty name="contenthelper" property="maxLines" value="300" />
    64  <jsp:setProperty name="contenthelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     65 <jsp:setProperty name="contenthelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    6566 <jsp:getProperty name="contenthelper" property="content" />
    6667</div></body></html>
  • apps/routerconsole/jsp/css.jsi

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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">
     
    78<%=intl.title("graphs")%>
    89 <jsp:useBean class="net.i2p.router.web.GraphHelper" id="graphHelper" scope="request" />
    9  <jsp:setProperty name="graphHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
     10 <jsp:setProperty name="graphHelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    1011<% /* GraphHelper sets the defaults in setContextId, so setting the properties must be after the context */ %>
    1112 <jsp:setProperty name="graphHelper" property="*" />
  • apps/routerconsole/jsp/help.jsp

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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/jobs.jsp

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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>
     
    200203        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
    201204        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
    202         <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
    203         <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
    204         <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
    205         <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
    206         <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
    207         <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
     205        <copy todir="build/" >
     206            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
     207        </copy>
    208208    </target>
    209209
     
    433433            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
    434434            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
     435            <group title="Jetty Logging" packages="net.i2p.jetty" />
    435436            <group title="SAM Bridge" packages="net.i2p.sam" />
    436437            <group title="SAM Demos" packages="net.i2p.sam.client" />
    437438            <group title="SusiDNS Application" packages="i2p.susi.dns" />
    438             <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
     439            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util:org.mortbay.servlet:org.mortbay.util" />
    439440            <group title="Systray Application" packages="net.i2p.apps.systray" />
    440441            <sourcepath>
     
    455456                <pathelement location="apps/susidns/src/java/src" />
    456457                <pathelement location="apps/susimail/src/src" />
     458                <pathelement location="apps/jetty/java/src" />
    457459            </sourcepath>
    458460            <classpath>
    459461                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
    460462                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
     463                <pathelement location="apps/jetty/jettylib/jetty-sslengine.jar" />
     464                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
     465                <pathelement location="apps/jetty/jettylib/jetty-java5-threadpool.jar" />
     466                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
     467                <pathelement location="apps/jetty/jettylib/jsp-api.jar" />
    461468                <pathelement location="apps/systray/java/lib/systray4j.jar" />
    462469                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
     
    664671    </target>
    665672
     673    <target name="webappDistclean">
     674        <ant dir="apps/i2ptunnel/java/" target="distclean" />
     675        <ant dir="apps/routerconsole/java/" target="distclean" />
     676        <ant dir="apps/addressbook/" target="distclean" />
     677        <ant dir="apps/susimail/" target="distclean" />
     678        <ant dir="apps/susidns/src/" target="distclean" />
     679        <ant dir="apps/i2psnark/java/" target="distclean" />
     680    </target>
     681
    666682    <target name="pkg" depends="distclean, updater, preppkg, installer" />
    667683
     
    799815        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
    800816        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
    801         <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
    802         <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
    803         <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
    804         <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
    805         <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
     817        <!-- all jetty stuff -->
     818        <copy todir="pkg-temp/lib" >
     819            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
     820        </copy>
    806821        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
    807822        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
    808         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    809823        <copy file="build/router.jar" todir="pkg-temp/lib/" />
    810824        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
     
    853867        <!-- Eepsite stuff here -->
    854868        <mkdir dir="pkg-temp/eepsite" />
    855         <mkdir dir="pkg-temp/eepsite/webapps" />
    856         <mkdir dir="pkg-temp/eepsite/logs" />
    857         <mkdir dir="pkg-temp/eepsite/cgi-bin" />
    858         <mkdir dir="pkg-temp/eepsite/docroot" />
    859         <mkdir dir="pkg-temp/eepsite/docroot/help" />
    860         <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
    861         <copy todir="pkg-temp/eepsite/docroot/" >
    862             <fileset dir="installer/resources/eepsite.help/" />
     869        <copy todir="pkg-temp/eepsite/" >
     870            <fileset dir="installer/resources/eepsite/" />
    863871        </copy>
    864872        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
     
    866874        </copy>
    867875        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
    868         <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
    869876    </target>
    870877
     
    880887         -->
    881888        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
     889        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
    882890        <!--  Not sure if these are used or should be included -->
    883891        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
     
    949957    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
    950958    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
     959    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
    951960    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
    952961    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
     
    10891098    </target>
    10901099
     1100    <!-- All jetty jars required for update.
     1101         We don't need commons-el or commons-logging, they haven't changed.
     1102         TODO do we need to bother updating jasper?
     1103         TODO where is JMX? We don't need it I hope.
     1104      -->
    10911105    <target name="prepjupdate" depends="prepupdate, buildWEB">
    1092         <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
    1093         <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
    1094         <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
    1095         <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
    1096         <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
    1097         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    1098     </target>
     1106        <copy todir="pkg-temp/lib" >
     1107            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
     1108        </copy>
     1109        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
     1110              can't overwrite an existing eepsite dir in a non-split configuration.
     1111          -->
     1112        <copy todir="pkg-temp/eepsite-jetty6" >
     1113            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
     1114        </copy>
     1115    </target>
     1116
     1117    <!-- Jetty 6 I2P logging addons, not really fixes -->
    10991118    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
    1100         <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
     1119        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
    11011120    </target>
    11021121
     
    15421561    <target name="debian-binary" >
    15431562        <echo message="Did you update the version using dch -i?" />
    1544         <echo message=" " />
    1545         <echo message="If the changelog was not updated with dch -i, press" />
    1546         <echo message="press CTRL+C to abort building this Debian package." />
    1547         <echo message="" />
    1548         <echo message="Pausing build for ten seconds to give enough time to read this notice." />
    1549         <exec executable="sleep" failonerror="true">
    1550                 <arg value="10" />
    1551         </exec>
     1563        <echo message=" " />
     1564        <echo message="If the changelog was not updated with dch -i, press" />
     1565        <echo message="press CTRL+C to abort building this Debian package." />
     1566        <echo message="" />
     1567        <echo message="Pausing build for ten seconds to give enough time to read this notice." />
     1568        <exec executable="sleep" failonerror="true">
     1569                <arg value="10" />
     1570        </exec>
    15521571        <echo message="====================" />
    1553         <!-- bundle the jetty 5 lib since there isn't a deb for it -->
    1554         <ant dir="apps/jetty" target="ensureJettylib" />
    1555        
    1556         <exec executable="fakeroot" failonerror="true">
    1557             <arg value="debian/rules" />
    1558             <arg value="patch" />
    1559             <arg value="binary" />
    1560             <arg value="clean" />
    1561         </exec>
    1562         <delete dir=".pc" />
    1563     </target>
     1572
     1573        <exec executable="fakeroot" failonerror="true">
     1574            <arg value="debian/rules" />
     1575            <arg value="patch" />
     1576            <arg value="binary" />
     1577            <arg value="clean" />
     1578        </exec>
     1579        <delete dir=".pc" />
     1580    </target>
     1581
    15641582    <target name="debian-clean" depends="buildProperties" >
    15651583        <exec executable="fakeroot" failonerror="true">
    1566             <arg value="debian/rules" />
    1567             <arg value="clean" />
    1568         </exec>
    1569         <delete dir="./.pc" />
    1570     </target>
     1584            <arg value="debian/rules" />
     1585            <arg value="clean" />
     1586        </exec>
     1587        <delete dir="./.pc" />
     1588    </target>
     1589
    15711590    <target name="debian-patch" depends="buildProperties" >
    15721591        <exec executable="quilt" failonerror="true">
     
    15781597    <target name="debian-unpatch" depends="buildProperties">
    15791598        <exec executable="quilt" failonerror="false">
    1580             <arg value="-a" />
    1581             <arg value="pop" />
     1599            <arg value="-a" />
     1600            <arg value="pop" />
    15821601        </exec>
    15831602    </target>
  • debian/control

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
     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

    r140ffc5 r2b81cee  
    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

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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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

    r140ffc5 r2b81cee  
    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)
     
    299305                out.println(s);
    300306            }
    301             System.err.println("Copied clients.config with modifications");
     307            System.err.println("Copied " + oldFile + " with modifications");
    302308            return true;
    303309        } catch (IOException ioe) {
    304310            if (in != null) {
    305                 System.err.println("FAILED copy clients.config");
     311                System.err.println("FAILED copy " + oldFile + ": " + ioe);
    306312                return false;
    307313            }
     
    318324     *  do it again with modifications.
    319325     */
    320     private static boolean migrateJettyXml(File olddir, File todir) {
    321         File eepsite1 = new File(olddir, "eepsite");
    322         File oldFile = new File(eepsite1, "jetty.xml");
    323         File eepsite2 = new File(todir, "eepsite");
    324         File newFile = new File(eepsite2, "jetty.xml");
     326    static boolean migrateJettyXml(File olddir, File todir, String filename, String oldString, String newString) {
     327        File oldFile = new File(olddir, filename);
     328        File newFile = new File(todir, filename);
    325329        FileInputStream in = null;
    326330        PrintWriter out = null;
     
    330334            String s = null;
    331335            while ((s = DataHelper.readLine(in)) != null) {
    332                 if (s.indexOf("./eepsite/") >= 0) {
    333                     s = s.replace("./eepsite/", todir.getAbsolutePath() + File.separatorChar + "eepsite" + File.separatorChar);
     336                if (s.indexOf(oldString) >= 0) {
     337                    s = s.replace(oldString, newString);
    334338                }
    335339                out.println(s);
    336340            }
    337341            out.println("<!-- Modified by I2P User dir migration script -->");
    338             System.err.println("Copied jetty.xml with modifications");
     342            System.err.println("Copied " + oldFile + " with modifications");
    339343            return true;
    340344        } catch (IOException ioe) {
    341345            if (in != null) {
    342                 System.err.println("FAILED copy jetty.xml");
     346                System.err.println("FAILED copy " + oldFile + ": " + ioe);
    343347                return false;
    344348            }
     
    396400     * @return true if it was copied successfully
    397401     */
    398     private static boolean copyFile(File src, File dst) {
     402    static boolean copyFile(File src, File dst) {
    399403        if (!src.exists()) return false;
    400404        boolean rv = true;
     
    413417            System.err.println("Copied " + src.getPath());
    414418        } catch (IOException ioe) {
    415             System.err.println("FAILED copy " + src.getPath());
     419            System.err.println("FAILED copy " + src.getPath() + ": " + ioe);
    416420            rv = false;
    417421        } finally {
Note: See TracChangeset for help on using the changeset viewer.