예제 #1
0
 @Override
 public void service(HttpServletRequest request, HttpServletResponse response)
     throws IOException, ServletException {
   ISession session = null;
   String login = new String(Base64.decodeBase64(request.getParameter(PARAM_LOGIN)), "UTF-8");
   String error = null;
   if (login != null) {
     try {
       session = ServerConfig.authorityCenter().login(login);
     } catch (Throwable e) {
       error = e.getMessage();
     }
   }
   response.setCharacterEncoding("UTF-8");
   response.setContentType("text/html; charset=UTF-8");
   if (session == null) {
     response.getWriter().print("{ success:false, error:\"" + error + "\" }");
   } else {
     response.getWriter().print("{ success:true, sessionId:\"" + session.id() + "\" }");
   }
 }
예제 #2
0
  protected void service(
      ISession session,
      Map<String, String> parameters,
      List<file> files,
      HttpServletRequest request,
      HttpServletResponse response)
      throws IOException, ServletException {
    GNode node = new GNode(parameters, files);

    IApplicationServer server = session.getServerInfo().getServer();
    node = server.processRequest(session, node);

    if (response != null) writeResponse(response, node.getContent());
  }