|
|
|
@ -43,19 +43,19 @@ public class servlet extends HttpServlet { |
|
|
|
/******************************************************************/ |
|
|
|
|
|
|
|
static { reflect.loadLibrary("servlet"); } |
|
|
|
native void startup(); |
|
|
|
native long define(String name); |
|
|
|
native void send(String requestMethod, String queryString, |
|
|
|
public native void startup(); |
|
|
|
public native long define(String name); |
|
|
|
public native void send(String requestMethod, String queryString, |
|
|
|
String pathInfo, String pathTranslated, |
|
|
|
String contentType, int contentLength, String authUser, |
|
|
|
boolean display_source_mode); |
|
|
|
native void shutdown(); |
|
|
|
public native void shutdown(); |
|
|
|
|
|
|
|
/******************************************************************/ |
|
|
|
/* sapi callbacks */ |
|
|
|
/******************************************************************/ |
|
|
|
|
|
|
|
String readPost(int bytes) { |
|
|
|
public String readPost(int bytes) { |
|
|
|
String result; |
|
|
|
if (!request.getMethod().equals("POST")) { |
|
|
|
result = request.getQueryString(); |
|
|
|
@ -74,14 +74,14 @@ public class servlet extends HttpServlet { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
String readCookies() { |
|
|
|
public String readCookies() { |
|
|
|
reflect.setResult(define("request"), request); |
|
|
|
reflect.setResult(define("response"), response); |
|
|
|
reflect.setResult(define("PHP_SELF"), request.getRequestURI()); |
|
|
|
return request.getHeader("cookie"); |
|
|
|
} |
|
|
|
|
|
|
|
void header(String data) { |
|
|
|
public void header(String data) { |
|
|
|
|
|
|
|
// try to send the header using the most specific servlet API |
|
|
|
// as possible (some servlet engines will add a content type |
|
|
|
@ -110,7 +110,7 @@ public class servlet extends HttpServlet { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void write(String data) { |
|
|
|
public void write(String data) { |
|
|
|
try { |
|
|
|
response.getWriter().print(data); |
|
|
|
} catch (IOException e) { |
|
|
|
|