Package controllers

Source Code of controllers.CommandController

package controllers;

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

import models.RunningState;

public class CommandController extends HttpServlet {

  /**
   *
   */
  private static final long serialVersionUID = 1L;
  public void doGet(HttpServletRequest request,
              HttpServletResponse response)
    throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    out.println("Hello World");
  }
  public void doPost(HttpServletRequest request,
            HttpServletResponse response)
  throws ServletException, IOException {
    ServletContext context = getServletContext();
    RunningState state = (RunningState)context.getAttribute("RunningState");
    state.empty();
    ChatController.broadcast("<Running state reset");
  PrintWriter out = response.getWriter();
  out.println("done");
}
}
TOP

Related Classes of controllers.CommandController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.