Replaced webserver with Jetty.
This commit is contained in:
parent
db3ab5a437
commit
3c4a88a874
19 changed files with 1081 additions and 1020 deletions
18
src/main/java/org/dynmap/servlet/JSONServlet.java
Normal file
18
src/main/java/org/dynmap/servlet/JSONServlet.java
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package org.dynmap.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.json.simple.JSONAware;
|
||||
import org.json.simple.JSONStreamAware;
|
||||
|
||||
public class JSONServlet {
|
||||
public static void respond(HttpServletResponse response, JSONStreamAware json) throws IOException {
|
||||
response.setContentType("application/json");
|
||||
PrintWriter writer = response.getWriter();
|
||||
json.writeJSONString(writer);
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue