Mercurial Hosting > luan
comparison src/luan/tools/WebShell.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 | d00f41edbbd6 |
children |
comparison
equal
deleted
inserted
replaced
129:486a0641bca4 | 130:0594c132888b |
---|---|
29 protected LuanState newLuanState() throws LuanException { | 29 protected LuanState newLuanState() throws LuanException { |
30 return LuanState.newStandard(); | 30 return LuanState.newStandard(); |
31 } | 31 } |
32 | 32 |
33 protected Object[] eval(LuanState luan,String cmd) throws LuanException { | 33 protected Object[] eval(LuanState luan,String cmd) throws LuanException { |
34 return Luan.array(luan.eval(cmd,"WebShell",true)); | 34 return Luan.array(luan.eval(cmd)); |
35 } | 35 } |
36 | 36 |
37 @Override protected void service(HttpServletRequest request,HttpServletResponse response) | 37 @Override protected void service(HttpServletRequest request,HttpServletResponse response) |
38 throws ServletException, IOException | 38 throws ServletException, IOException |
39 { | 39 { |
67 Object[] result = eval(luan,cmd); | 67 Object[] result = eval(luan,cmd); |
68 if( result.length > 0 ) { | 68 if( result.length > 0 ) { |
69 for( int i=0; i<result.length; i++ ) { | 69 for( int i=0; i<result.length; i++ ) { |
70 if( i > 0 ) | 70 if( i > 0 ) |
71 writer.write(" "); | 71 writer.write(" "); |
72 writer.write(HtmlLib.encode(luan.JAVA.toString(result[i]))); | 72 writer.write(HtmlLib.encode(luan.toString(result[i]))); |
73 } | 73 } |
74 writer.write("\r\n"); | 74 writer.write("\r\n"); |
75 } | 75 } |
76 } catch(LuanException e) { | 76 } catch(LuanException e) { |
77 logger.info("",e); | 77 logger.info("",e); |