Changeset 221499c for apps


Ignore:
Timestamp:
Jan 22, 2012 6:30:41 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
061f96a
Parents:
c3bf470a (diff), ba01451 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

propagate from branch 'i2p.i2p' (head 156f8e6137be3c25aa70176fe0a78218b898a684)

to branch 'i2p.i2p.zzz.jetty6' (head 960f416b20e26662b1b5b30468a85dbb25f09ffd)

Location:
apps
Files:
15 added
13 deleted
68 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/Servlet.java

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    5353
    5454
    55     <!-- TODO: Move the web classes from the jar to the war - they are not part of the API
    56       -  This will require sponge to rewrite some seedless stuff that uses it.
    57      -->
     55    <!-- The web classes are now in the war not the jar - they are not part of the API -->
    5856    <target name="jar" depends="builddep, compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
    5957        <!-- set if unset -->
    6058        <property name="workspace.changes.j.tr" value="" />
    61         <jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class">
     59        <jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/EditBean.class **/IndexBean.class" >
    6260            <manifest>
    6361                <attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
     
    6967            </manifest>
    7068        </jar>
     69        <jar destfile="./build/temp-beans.jar" basedir="./build/obj" includes="**/EditBean.class **/IndexBean.class" />
    7170    </target>
    7271
     
    130129    </target>
    131130
     131    <!-- The web classes are now in the war not the jar - they are not part of the API -->
    132132    <target name="war" depends="precompilejsp, bundle, warUpToDate, listChangedFiles2" unless="war.uptodate" >
    133133        <!-- set if unset -->
    134134        <property name="workspace.changes.w.tr" value="" />
     135        <copy file="build/obj/net/i2p/i2ptunnel/web/EditBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
     136        <copy file="build/obj/net/i2p/i2ptunnel/web/IndexBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
    135137        <war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
    136138             basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
     
    172174                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    173175                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     176                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    174177                <pathelement location="../../jetty/jettylib/ant.jar" />
    175178                <pathelement location="build/i2ptunnel.jar" />
     179                <pathelement location="build/temp-beans.jar" />
    176180            </classpath>
    177181            <arg value="-d" />
    178182            <arg value="../jsp/WEB-INF/classes" />
     183            <arg value="-v" />
    179184            <arg value="-p" />
    180185            <arg value="net.i2p.i2ptunnel.jsp" />
     
    193198                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    194199                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     200                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    195201                <pathelement location="build/i2ptunnel.jar" />
     202                <pathelement location="build/temp-beans.jar" />
    196203            </classpath>
    197204        </javac>
  • apps/i2ptunnel/jsp/edit.jsp

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

    rc3bf470a r221499c  
    2222                <pathelement location="../../../router/java/build/obj" />
    2323                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     24                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     25                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     26                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
    2427                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     28                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     29                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    2530                <pathelement location="../../systray/java/build/obj" />
    2631                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    5560                <pathelement location="../../../router/java/build/router.jar" />
    5661                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     62                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     63                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     64                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
    5765                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     66                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     67                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    5868                <pathelement location="../../systray/java/build/systray.jar" />
    5969                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    237247                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    238248                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     249                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
    239250                <pathelement location="../../jetty/jettylib/ant.jar" />
     251                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    240252                <pathelement location="../../systray/java/build/obj" />
    241253                <pathelement location="../../systray/java/lib/systray4j.jar" />
     
    270282                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    271283                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     284                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     285                <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
     286                <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
     287                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
     288                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
    272289                <pathelement location="../../systray/java/build/obj" />
    273290                <pathelement location="../../systray/java/lib/systray4j.jar" />
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    3333import net.i2p.util.VersionComparator;
    3434
    35 import org.mortbay.jetty.Server;
     35import org.mortbay.jetty.handler.ContextHandlerCollection;
    3636
    3737
     
    255255
    256256        // start console webapps in console/webapps
    257         Server server = WebAppStarter.getConsoleServer();
     257        ContextHandlerCollection server = WebAppStarter.getConsoleServer();
    258258        if (server != null) {
    259259            File consoleDir = new File(pluginDir, "console");
     
    355355
    356356        // stop console webapps in console/webapps
    357         Server server = WebAppStarter.getConsoleServer();
    358         if (server != null) {
     357        //ContextHandlerCollection server = WebAppStarter.getConsoleServer();
     358        //if (server != null) {
    359359        /*
    360360            File consoleDir = new File(pluginDir, "console");
     
    376376                while (wars.hasNext()) {
    377377                    String warName = wars.next();
    378                     WebAppStarter.stopWebApp(server, warName);
     378                    WebAppStarter.stopWebApp(warName);
    379379                }
    380380                pluginWars.get(appName).clear();
    381381            }
    382         }
     382        //}
    383383
    384384        // remove summary bar link
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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

    rc3bf470a r221499c  
    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) {}
Note: See TracChangeset for help on using the changeset viewer.