α» NooMicJsp edit** « wiki αt10xxxxx

Behind http://noopolis.org/ there is simply:
  • a running HadoopHBase
  • A WebApp with jars:
  • CloJure
  • HadoopHBase
  • http://mesh.dl.sourceforge.net/sourceforge/json-lib/json-lib-2.2.3-jdk15.jar
  • http://mesh.dl.sourceforge.net/sourceforge/fb4j/fb4j-0.1.3-alpha.jar
  • http://caucho.com/m2/com/caucho/resin-quercus/3.2.0/resin-quercus-3.2.0.jar
  • ApacheDerby
  • with the following JSP: {{{ <%@ page import=" java.io.BufferedReader, java.io.InputStreamReader, java.io.PushbackReader, java.io.StringReader, java.io.StringWriter, java.net.URL, clojure.lang.Compiler, clojure.lang.LispReader, clojure.lang.RT, clojure.lang.Var "%><% Var noomicFn=(Var) application.getAttribute("clojure"); if (null== noomicFn ||"/refreshClojure".equals( request.getPathInfo() ) ) { RT.var("clojure.core","application", application); URL url = new URL("http://mindbroker.de/wiki/NooMicClj?skin=raw"); BufferedReader br= new BufferedReader( new InputStreamReader( url.openConnection().getInputStream(),"UTF-8")); //11 times: br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); br.readLine(); String line; StringWriter sw=new StringWriter(); while ((line=br.readLine() ) != null ) { line=line.replace(""","\""); line=line.replace("<","<"); line=line.replace(">",">"); sw.append(line); sw.append('\r'); } //test: String s="(defn noomic [request response] (str \"hello \" (.getParameter request \"param\")))\n\r"; Object noomicExpr=LispReader.read(new PushbackReader(new StringReader(sw.toString())), true, null, false); noomicFn=(Var) Compiler.eval( noomicExpr); application.setAttribute("clojure", noomicFn); } %><%=noomicFn.invoke(request,response)%> }}} and this web.xml: {{{ NooPolis NooPolis index /index.jsp index /* }}} So when you edit NooMic, it will go live to http://noopolis.org/.