Changeset 4e635aa


Ignore:
Timestamp:
Apr 16, 2016 4:05:19 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
a438722
Parents:
25fe886e
Message:

Console: Add JSTL version to /logs

Location:
apps/routerconsole
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java

    r25fe886e r4e635aa  
    66import java.io.InputStreamReader;
    77import java.io.IOException;
     8import java.lang.reflect.Method;
    89import java.util.ArrayList;
    910import java.util.List;
     
    2021
    2122    private static final String LOCATION_AVAILABLE = "3.3.7";
    22    
     23    private static final String _jstlVersion = jstlVersion();
     24
    2325    /** @since 0.8.12 */
    2426    public String getJettyVersion() {
     
    4042        }
    4143        return buf.toString();
     44    }
     45
     46    /**
     47     * @return non-null, "n/a" on failure
     48     * @since 0.9.26
     49     */
     50    public String getJstlVersion() {
     51        return _jstlVersion;
     52    }
     53
     54    /**
     55     * @return non-null, "n/a" on failure
     56     * @since 0.9.26
     57     */
     58    private static String jstlVersion() {
     59        String rv = "n/a";
     60        try {
     61            Class<?> cls = Class.forName("org.apache.taglibs.standard.Version", true, ClassLoader.getSystemClassLoader());
     62            Method getVersion = cls.getMethod("getVersion");
     63            // returns "standard-taglib 1.2.0"
     64            Object version = getVersion.invoke(null, (Object[]) null);
     65            rv = (String) version;
     66            //int sp = rv.indexOf(' ');
     67            //if (sp >= 0 && rv.length() > sp + 1)
     68            //    rv = rv.substring(sp + 1);
     69        } catch (Exception e) {}
     70        return rv;
    4271    }
    4372
  • apps/routerconsole/jsp/logs.jsp

    r25fe886e r4e635aa  
    3131<b>Server version:</b> <jsp:getProperty name="logsHelper" property="jettyVersion" /><br>
    3232<b>Servlet version:</b> <%=getServletInfo()%><br>
     33<b>JSTL version:</b> <jsp:getProperty name="logsHelper" property="jstlVersion" /><br>
    3334<b>Platform:</b> <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br>
    3435<b>Processor:</b> <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)<br>
Note: See TracChangeset for help on using the changeset viewer.