diff --git a/apps/i2ptunnel/java/build.xml b/apps/i2ptunnel/java/build.xml index 2357f4ccc0bdb84c7a0ffaea8914759023cd6fee..47e9f8943f8b613f38e99b07d04fbe01a4d75c11 100644 --- a/apps/i2ptunnel/java/build.xml +++ b/apps/i2ptunnel/java/build.xml @@ -24,11 +24,46 @@ </jar> <ant target="war" /> </target> - <target name="war"> - <war destfile="build/i2ptunnel.war" webxml="../jsp/web.xml" - basedir="../jsp/" excludes="web.xml"> + <target name="war" depends="precompilejsp"> + <war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml" + basedir="../jsp/" excludes="web.xml, *.java, *.jsp"> </war> </target> + <target name="precompilejsp"> + <mkdir dir="../jsp/WEB-INF/" /> + <mkdir dir="../jsp/WEB-INF/classes" /> + <!-- there are various jspc ant tasks, but they all seem a bit flakey --> + <java classname="org.apache.jasper.JspC" fork="true" > + <classpath> + <pathelement location="../../jetty/jettylib/jasper-compiler.jar" /> + <pathelement location="../../jetty/jettylib/jasper-runtime.jar" /> + <pathelement location="../../jetty/jettylib/javax.servlet.jar" /> + <pathelement location="../../jetty/jettylib/ant.jar" /> + <pathelement location="build/i2ptunnel.jar" /> + </classpath> + <arg value="-d" /> + <arg value="../jsp/WEB-INF/classes" /> + <arg value="-v9" /> + <arg value="-p" /> + <arg value="net.i2p.i2ptunnel.jsp" /> + <arg value="-webinc" /> + <arg value="../jsp/web-fragment.xml" /> + <arg value="-webapp" /> + <arg value="../jsp/" /> + </java> + <javac destdir="../jsp/WEB-INF/classes/" srcdir="../jsp/WEB-INF/classes" includes="*.java"> + <classpath> + <pathelement location="../../jetty/jettylib/jasper-runtime.jar" /> + <pathelement location="../../jetty/jettylib/javax.servlet.jar" /> + <pathelement location="build/i2ptunnel.jar" /> + </classpath> + </javac> + <copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" /> + <loadfile property="jspc.web.fragment" srcfile="../jsp/web-fragment.xml" /> + <replace file="../jsp/web-out.xml"> + <replacefilter token="<!-- precompiled servlets -->" value="${jspc.web.fragment}" /> + </replace> + </target> <target name="javadoc"> <mkdir dir="./build" /> <mkdir dir="./build/javadoc" /> diff --git a/apps/i2ptunnel/jsp/index.html b/apps/i2ptunnel/jsp/index.html new file mode 100644 index 0000000000000000000000000000000000000000..ea1321105ebd70b339995c446e78b3377cff2f6b --- /dev/null +++ b/apps/i2ptunnel/jsp/index.html @@ -0,0 +1,2 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>I2P Router Console</title></head> +<body><meta http-equiv="refresh" content="0;url=index.jsp" /><a href="index.jsp">Enter</a></body></html> diff --git a/apps/i2ptunnel/jsp/web.xml b/apps/i2ptunnel/jsp/web.xml index 9a428440d413fc62a404a67d974abdb59607372f..b9953970086d323844b8da4ff18f7c8ee5c27845 100644 --- a/apps/i2ptunnel/jsp/web.xml +++ b/apps/i2ptunnel/jsp/web.xml @@ -4,14 +4,14 @@ "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> <web-app> + <!-- precompiled servlets --> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> - <welcome-file> - index.jsp - </welcome-file> + <welcome-file>index.html</welcome-file> + <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> \ No newline at end of file diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml index dd0a76e1abb4706f86a2df83e6fd8bbf2da441f0..b59a4413ccc4080c16dbb560e0a23fee84867a7c 100644 --- a/apps/routerconsole/java/build.xml +++ b/apps/routerconsole/java/build.xml @@ -26,11 +26,46 @@ </jar> <ant target="war" /> </target> - <target name="war"> - <war destfile="build/routerconsole.war" webxml="../jsp/web.xml" - basedir="../jsp/" excludes="web.xml"> + <target name="war" depends="precompilejsp"> + <war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml" + basedir="../jsp/" excludes="web.xml, *.java, *.jsp"> </war> </target> + <target name="precompilejsp"> + <mkdir dir="../jsp/WEB-INF/" /> + <mkdir dir="../jsp/WEB-INF/classes" /> + <!-- there are various jspc ant tasks, but they all seem a bit flakey --> + <java classname="org.apache.jasper.JspC" fork="true" > + <classpath> + <pathelement location="../../jetty/jettylib/jasper-compiler.jar" /> + <pathelement location="../../jetty/jettylib/jasper-runtime.jar" /> + <pathelement location="../../jetty/jettylib/javax.servlet.jar" /> + <pathelement location="../../jetty/jettylib/ant.jar" /> + <pathelement location="build/routerconsole.jar" /> + </classpath> + <arg value="-d" /> + <arg value="../jsp/WEB-INF/classes" /> + <arg value="-v9" /> + <arg value="-p" /> + <arg value="net.i2p.router.web.jsp" /> + <arg value="-webinc" /> + <arg value="../jsp/web-fragment.xml" /> + <arg value="-webapp" /> + <arg value="../jsp/" /> + </java> + <javac destdir="../jsp/WEB-INF/classes/" srcdir="../jsp/WEB-INF/classes" includes="*.java"> + <classpath> + <pathelement location="../../jetty/jettylib/jasper-runtime.jar" /> + <pathelement location="../../jetty/jettylib/javax.servlet.jar" /> + <pathelement location="build/routerconsole.jar" /> + </classpath> + </javac> + <copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" /> + <loadfile property="jspc.web.fragment" srcfile="../jsp/web-fragment.xml" /> + <replace file="../jsp/web-out.xml"> + <replacefilter token="<!-- precompiled servlets -->" value="${jspc.web.fragment}" /> + </replace> + </target> <target name="javadoc"> <mkdir dir="./build" /> <mkdir dir="./build/javadoc" /> diff --git a/apps/routerconsole/jsp/index.html b/apps/routerconsole/jsp/index.html new file mode 100644 index 0000000000000000000000000000000000000000..ea1321105ebd70b339995c446e78b3377cff2f6b --- /dev/null +++ b/apps/routerconsole/jsp/index.html @@ -0,0 +1,2 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>I2P Router Console</title></head> +<body><meta http-equiv="refresh" content="0;url=index.jsp" /><a href="index.jsp">Enter</a></body></html> diff --git a/apps/routerconsole/jsp/web.xml b/apps/routerconsole/jsp/web.xml index 9a428440d413fc62a404a67d974abdb59607372f..b9953970086d323844b8da4ff18f7c8ee5c27845 100644 --- a/apps/routerconsole/jsp/web.xml +++ b/apps/routerconsole/jsp/web.xml @@ -4,14 +4,14 @@ "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> <web-app> + <!-- precompiled servlets --> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> - <welcome-file> - index.jsp - </welcome-file> + <welcome-file>index.html</welcome-file> + <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> \ No newline at end of file