changeset 436:52a6295e92c9

support old jetty
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 03 May 2015 22:29:18 -0600
parents 5b36f663a1b8
children 6cfbf45a1885
files web/src/luan/modules/web/HttpServicer.java
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/web/src/luan/modules/web/HttpServicer.java	Sun May 03 21:28:49 2015 -0600
+++ b/web/src/luan/modules/web/HttpServicer.java	Sun May 03 22:29:18 2015 -0600
@@ -20,6 +20,8 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.Part;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.eclipse.jetty.util.MultiPartInputStream;
 import luan.Luan;
 import luan.LuanState;
@@ -39,6 +41,7 @@
 
 
 public final class HttpServicer {
+	private static final Logger logger = LoggerFactory.getLogger(HttpServicer.class);
 
 	public static boolean service(LuanState luan,HttpServletRequest request,HttpServletResponse response,String modName)
 		throws LuanException
@@ -325,9 +328,13 @@
 		add( tbl, "text_writer" );
 		add( tbl, "set_cookie", String.class, String.class, Boolean.TYPE, String.class );
 		add( tbl, "remove_cookie", String.class, String.class );
-		getters.rawPut( "status", new LuanJavaFunction(
-			HttpServletResponse.class.getMethod( "getStatus" ), response
-		) );
+		try {
+			getters.rawPut( "status", new LuanJavaFunction(
+				HttpServletResponse.class.getMethod( "getStatus" ), response
+			) );
+		} catch(NoSuchMethodException e) {
+			logger.info("please upgrade jetty");
+		}
 		setters.rawPut( "status", new LuanJavaFunction(
 			HttpServletResponse.class.getMethod( "setStatus", Integer.TYPE ), response
 		) );