Exemplo n.º 1
0
 /**
  * Validates the session id passed into the service
  *
  * @param params rpc parameters
  * @throws SessionTimedOutException in all cases unless the sessionId is valid
  */
 /* package */ void validateSession(Object[] params) throws SessionTimedOutException {
   if (params != null && params.length > 0 && (params[0] instanceof String)) {
     String s = (String) params[0];
     BaseService bs = (BaseService) service;
     if (bs.isSessionValid(s) == false) {
       throw new SessionTimedOutException();
     }
   } else {
     // default
     throw new SessionTimedOutException();
   }
 }
Exemplo n.º 2
0
  /* (non-Javadoc)
   * @see org.springframework.web.servlet.mvc.Controller#handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    final HttpSession session = request.getSession(true);
    LOGGER.debug("session id: " + session.getId());

    // inject the session into the service class
    ((BaseService) service).setHttpSession(session);

    // delegate, will eventually call into processCall below
    super.doPost(request, response);

    // no need for ModelAndView
    return null;
  }