ITeye博客

learn for code

turingfellow · 2010-07-11 10:23 · jade · 编程语言 · Markdown

<%@ page import="jade.core.*" %> <jsp:useBean id="oldsnooper" class="examples.jsp.Snooper" scope="application"> <% try { // Does not work for the moment // JADE 1.4 String args = {"-platform", "buffer:examples.jsp.Buffer"}; String args = {"-container"}; jade.Boot.main(args); System.out.println("Jade Inited()"); System.out.println("Start"); oldsnooper.doStart("oldsnooper"); } catch (Exception ex) { out.println(ex); } %> </jsp:useBean>

<% oldsnooper.snoop(request.getRemoteHost()+" "+(new java.util.Date())+" "+request.getRequestURI()); %>

jade启动的方式原来还有jade.Boot.main受教了。把参数放在args里,就像是在用命令行一样。 String args2 = { "-gui" }; jade.Boot.main(args2); Runtime rt = Runtime.instance(); Profile pMain = new ProfileImpl(null, 5689, null); AgentContainer mc = rt.createMainContainer(pMain); rt.setCloseVM(false); try { AgentController rma = mc.createNewAgent("rma", "jade.tools.rma.rma", new Object); rma.start();

	} catch (StaleProxyException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。