You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class MainTest {
public static void main(String[] args) {
final Serve srv = new Serve();
java.util.Properties properties = new java.util.Properties();
properties.put("port", 80);
properties.setProperty(com.koogu.server.Serve.ARG_NOHUP, "nohup");
//properties.setProperty("acceptorImpl", "Acme.Serve.SelectorAcceptor"); // this acceptor is requireed for websocket support.
srv.arguments = properties;
srv.addServlet("/*", new HttpServlet() {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.println("test="+req.getParameter("test"));
}
}, null); // optional
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
public void run() {
srv.notifyStop();
srv.destroyAllServlets();
}
}));
srv.serve();
}
public class MainTest {
public static void main(String[] args) {
final Serve srv = new Serve();
java.util.Properties properties = new java.util.Properties();
properties.put("port", 80);
properties.setProperty(com.koogu.server.Serve.ARG_NOHUP, "nohup");
}
then doGet was invoked twice:
URL: http://localhost/a?test=123
output as:
test=123
test=null
The text was updated successfully, but these errors were encountered: