diff src/luan/tools/WebServlet.java @ 86:6db8f286fa6c

_ENV is per module, not global git-svn-id: https://luan-java.googlecode.com/svn/trunk@87 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 27 Feb 2013 08:03:51 +0000
parents cca4f8522893
children b1e87f1bcc13
line wrap: on
line diff
--- a/src/luan/tools/WebServlet.java	Mon Feb 25 03:53:54 2013 +0000
+++ b/src/luan/tools/WebServlet.java	Wed Feb 27 08:03:51 2013 +0000
@@ -23,8 +23,6 @@
 
 public class WebServlet extends HttpServlet {
 
-	public static final String HTTP_SERVER = "http_server";
-
 	protected LuanState luanState = null;
 
 	protected void loadLibs(LuanState luan) throws LuanException {
@@ -39,10 +37,7 @@
 	protected LuanState newLuanState() throws LuanException {
 		LuanState luan = LuanCompiler.newLuanState();
 		loadLibs(luan);
-		PackageLib.require(luan,HTTP_SERVER);
-		Object fn = luan.global().get(HttpLib.FN_NAME);
-		if( !(fn instanceof LuanFunction) )
-			throw new LuanException( luan, LuanElement.JAVA, "function '"+HttpLib.FN_NAME+"' not defined" );
+		HttpLib.load(luan);
 		return luan;
 	}
 
@@ -54,7 +49,7 @@
 		return luanState.deepClone();
 	}
 
-	protected void service(HttpServletRequest request,HttpServletResponse response)
+	@Override protected void service(HttpServletRequest request,HttpServletResponse response)
 		throws ServletException, IOException
 	{
 		try {