コード例 #1
0
  protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    dao = new ConnectionPool();
    request.getSession().setAttribute("access", "user");
    Action action = ActionFactory.getAction(request);
    user = (UserDAO) action.handleRequest(request, response, dao);

    // ------------
    User myInfo = user.getMyAccont();
    // ------------
    request.setAttribute("user", user); // delete! don't need transferring
    // ------------
    HttpSession lastAct = request.getSession();
    String la = (String) lastAct.getAttribute("lastActions");
    if (la.compareTo("/view/user.jsp") == 0) {
      super.forward("/view/user.jsp", request, response);
    } else {
      super.forward(la, request, response);
    }
  }
コード例 #2
0
  public void destroy() {
    WebApplicationContext webContext = getWebApplicationContext();
    GrailsApplication application =
        (GrailsApplication)
            webContext.getBean(GrailsApplication.APPLICATION_ID, GrailsApplication.class);

    GrailsClass[] bootstraps = application.getArtefacts(BootstrapArtefactHandler.TYPE);
    for (int i = 0; i < bootstraps.length; i++) {
      ((GrailsBootstrapClass) bootstraps[i]).callDestroy();
    }
    super.destroy();
  }
コード例 #3
0
 protected void initFrameworkServlet() throws ServletException, BeansException {
   super.initFrameworkServlet();
   initMultipartResolver();
 }
コード例 #4
0
 public ServletHttpServer(URL url, HttpHandler handler) {
   super(url, handler);
   DispatcherServlet.addHttpHandler(url.getPort(), handler);
 }