add rm command
[org.ibex.xt-crawshaw.git] / src / java / org / ibex / xt / ShellServlet.java
index bc53366..e9fc0a8 100644 (file)
@@ -1,14 +1,9 @@
 package org.ibex.xt;
 
 import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.regex.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 
-import org.ibex.util.*;
-import org.ibex.util.Collections;
 import org.ibex.js.*;
 
 import org.prevayler.*;
@@ -36,10 +31,16 @@ public class ShellServlet extends HttpServlet {
 
         JSScope scope = (JSScope)rq.getSession().getAttribute("scope");
         if (scope == null) {
-            System.out.println("creating new scope");
             try {
-                scope = new JSScope(null);
-                scope.put("prevalent", prevalent);
+                scope = new JSScope(null) {
+                    { super.put("prevalent", prevalent); }
+
+                    public void put(String k, String v) throws JSExn {
+                        if (k != null && k.equals("prevalent")) throw new JSExn(
+                            "can not replace key prevalent");
+                        super.put(k, v);
+                    }
+                };
             } catch (JSExn e) {
                 e.printStackTrace();
                 throw new IOException("unexpected JSExn");