Mercurial Hosting > luan
comparison src/luan/lib/HttpLib.java @ 130:0594c132888b
cleanup
git-svn-id: https://luan-java.googlecode.com/svn/trunk@131 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 10 Jun 2014 02:43:40 +0000 |
parents | f537ff5e511d |
children | 3119326260ea |
comparison
equal
deleted
inserted
replaced
129:486a0641bca4 | 130:0594c132888b |
---|---|
26 | 26 |
27 public static void load(LuanState luan) throws LuanException { | 27 public static void load(LuanState luan) throws LuanException { |
28 PackageLib.require(luan,NAME); | 28 PackageLib.require(luan,NAME); |
29 Object fn = luan.get(HttpLib.FN_NAME); | 29 Object fn = luan.get(HttpLib.FN_NAME); |
30 if( !(fn instanceof LuanFunction) ) | 30 if( !(fn instanceof LuanFunction) ) |
31 throw luan.JAVA.exception( "function '"+HttpLib.FN_NAME+"' not defined" ); | 31 throw luan.exception( "function '"+HttpLib.FN_NAME+"' not defined" ); |
32 } | 32 } |
33 | 33 |
34 public static void service(LuanState luan,HttpServletRequest request,HttpServletResponse response) | 34 public static void service(LuanState luan,HttpServletRequest request,HttpServletResponse response) |
35 throws LuanException, IOException | 35 throws LuanException, IOException |
36 { | 36 { |
44 new HttpLib(request,response,module); | 44 new HttpLib(request,response,module); |
45 } catch(NoSuchMethodException e) { | 45 } catch(NoSuchMethodException e) { |
46 throw new RuntimeException(e); | 46 throw new RuntimeException(e); |
47 } | 47 } |
48 | 48 |
49 luan.JAVA.call(fn,FN_NAME); | 49 luan.call(fn,FN_NAME); |
50 } | 50 } |
51 | 51 |
52 private final HttpServletRequest request; | 52 private final HttpServletRequest request; |
53 private final HttpServletResponse response; | 53 private final HttpServletResponse response; |
54 | 54 |