Mercurial Hosting > luan
comparison src/luan/lib/HttpLib.java @ 88:6ca02b188dba
add LuanBit to clean up code;
add repr();
git-svn-id: https://luan-java.googlecode.com/svn/trunk@89 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Wed, 27 Feb 2013 23:50:32 +0000 |
parents | 6db8f286fa6c |
children | 8ef2d6701541 |
comparison
equal
deleted
inserted
replaced
87:eaf37cfa30c2 | 88:6ca02b188dba |
---|---|
22 | 22 |
23 public static void load(LuanState luan) throws LuanException { | 23 public static void load(LuanState luan) throws LuanException { |
24 PackageLib.require(luan,NAME); | 24 PackageLib.require(luan,NAME); |
25 Object fn = luan.get(HttpLib.FN_NAME); | 25 Object fn = luan.get(HttpLib.FN_NAME); |
26 if( !(fn instanceof LuanFunction) ) | 26 if( !(fn instanceof LuanFunction) ) |
27 throw new LuanException( luan, LuanElement.JAVA, "function '"+HttpLib.FN_NAME+"' not defined" ); | 27 throw luan.JAVA.exception( "function '"+HttpLib.FN_NAME+"' not defined" ); |
28 } | 28 } |
29 | 29 |
30 public static void service(LuanState luan,HttpServletRequest request,HttpServletResponse response) | 30 public static void service(LuanState luan,HttpServletRequest request,HttpServletResponse response) |
31 throws LuanException, IOException | 31 throws LuanException, IOException |
32 { | 32 { |
47 parameter_lists.put( name, new LuanTable(Arrays.asList((Object[])values)) ); | 47 parameter_lists.put( name, new LuanTable(Arrays.asList((Object[])values)) ); |
48 } | 48 } |
49 module.put("parameters",parameters); | 49 module.put("parameters",parameters); |
50 module.put("parameter_lists",parameter_lists); | 50 module.put("parameter_lists",parameter_lists); |
51 | 51 |
52 luan.call(fn,LuanElement.JAVA,FN_NAME); | 52 luan.JAVA.call(fn,FN_NAME); |
53 } | 53 } |
54 /* | 54 /* |
55 private final HttpServletRequest request; | 55 private final HttpServletRequest request; |
56 private final HttpServletResponse response; | 56 private final HttpServletResponse response; |
57 | 57 |