Changeset 3131e65


Ignore:
Timestamp:
Feb 20, 2012 2:32:48 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
1f9ab5d
Parents:
1997be37
Message:

fix redirection; change header

Location:
apps/routerconsole/jsp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/jsp/home.jsp

    r1997be37 r3131e65  
    139139  <jsp:setProperty name="homehelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
    140140  <div class="ag2">
    141     <h4 class="app"><%=intl._("Recommended Eepsites")%></h4>
     141    <h4 class="app"><%=intl._("Eepsites of Interest")%></h4>
    142142    <jsp:getProperty name="homehelper" property="favorites" /><br>
    143143  </div>
  • apps/routerconsole/jsp/index.jsp

    r1997be37 r3131e65  
    22<%@page pageEncoding="UTF-8"%>
    33<%
     4    //
     5    //  Redirect to either /home or /console, depending on configuration,
     6    //  while preserving any query parameters
     7    //
    48    response.setStatus(302, "Moved");
    5     String req = request.getRequestURI();
     9    String req = request.getRequestURL().toString();
     10    StringBuilder buf = new StringBuilder(128);
    611    if (req.endsWith("index"))
    712        req = req.substring(0, req.length() - 5);
    813    else if (req.endsWith("index.jsp"))
    914        req = req.substring(0, req.length() - 9);
     15    buf.append(req);
    1016    if (!req.endsWith("/"))
    11         req += '/';
     17        buf.append('/');
    1218    boolean oldHome = net.i2p.I2PAppContext.getGlobalContext().getBooleanProperty("routerconsole.oldHomePage");
    1319    if (oldHome)
    14         req += "console";
     20        buf.append("console");
    1521    else
    16         req += "home";
    17     response.setHeader("Location", req);
     22        buf.append("home");
     23    String query = request.getQueryString();
     24    if (query != null)
     25        buf.append('?').append(query);
     26    response.setHeader("Location", buf.toString());
    1827%>
Note: See TracChangeset for help on using the changeset viewer.