hook up the mw client app with the jsp
This commit is contained in:
@ -29,6 +29,7 @@ task precompileJsp {
|
||||
def generated = new File("$buildDir/tmp_jsp")
|
||||
generated.mkdirs()
|
||||
ant.jasper(package: 'com.muwire.webui',
|
||||
classPath : sourceSets.main.runtimeClasspath.asPath,
|
||||
uriroot: webAppDir,
|
||||
outputDir: "$buildDir/tmp_jsp",
|
||||
compilerSourceVM: "1.8",
|
||||
@ -37,8 +38,8 @@ task precompileJsp {
|
||||
def output = new File("$buildDir/compiledJsps")
|
||||
output.mkdirs()
|
||||
ant.javac(srcDir: 'build/tmp_jsp',
|
||||
destDir:file("$buildDir/compiledJsps"),
|
||||
classpath: configurations.compile.asPath)
|
||||
classPath : sourceSets.main.runtimeClasspath.asPath,
|
||||
destDir:file("$buildDir/compiledJsps"))
|
||||
|
||||
}
|
||||
}
|
||||
@ -54,6 +55,7 @@ task generateWebXML {
|
||||
}
|
||||
}
|
||||
|
||||
precompileJsp.dependsOn compileJava
|
||||
generateWebXML.dependsOn precompileJsp
|
||||
war.dependsOn generateWebXML
|
||||
|
||||
|
21
webui/src/main/java/com/muwire/webui/MuWireBean.java
Normal file
21
webui/src/main/java/com/muwire/webui/MuWireBean.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.muwire.webui;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
public class MuWireBean implements Serializable {
|
||||
|
||||
private final Object mwClient;
|
||||
|
||||
public MuWireBean() {
|
||||
mwClient = ((RouterContext)I2PAppContext.getGlobalContext()).clientAppManager().getRegisteredApp("MuWire");
|
||||
System.out.println("mwClient is "+mwClient);
|
||||
}
|
||||
|
||||
public Object getMwClient() {
|
||||
return mwClient;
|
||||
}
|
||||
|
||||
}
|
@ -44,6 +44,7 @@ public class MuWireClient implements RouterApp {
|
||||
this.home = home;
|
||||
this.mwProps = new File(home, "MuWire.properties");
|
||||
this.state = ClientAppState.INITIALIZED;
|
||||
mgr.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,11 +1,19 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>MuWire</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Nothing here yet</p>
|
||||
<jsp:useBean id="mwBean" class="com.muwire.webui.MuWireBean"/>
|
||||
<c:set var="mwClient" scope="application" value="${mwBean.getMwClient()}"/>
|
||||
<c:if test = "${mwClient.needsMWInit()}">
|
||||
<p>MW needs initializing</p>
|
||||
</c:if>
|
||||
<c:if test = "${!mwClient.needsMWInit()}">
|
||||
<p>MW doesn't need initing</p>
|
||||
</c:if>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user