Package pt.opensoft.webmvc.action

Examples of pt.opensoft.webmvc.action.NotAllowedException


    public void allows(HttpRequest request, ActionWrapper actionWrapper) {
        if (needsLogin(actionWrapper.getCompleteModuleName(), actionWrapper.getActionName())) {
            HttpSession session = (HttpSession) request.getSession();
            if (session == null || !session.isValid()) {
                throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
            } else {
              if(session.getValue(_sessionUserTag) == null) {
                throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
              }
            }
        }
    }
View Full Code Here


    super();
  }

  public void allows(HttpRequest request, ActionWrapper actionWrapper) {
    if (!isSecure(request)) {
      throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
    }
  }
View Full Code Here

    if (request.isPost()) {
      return;
    }

    if (request.isGet()) {
          throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
        }

        throw new RuntimeException("Invalid method: " + request.getMethod());
  }
View Full Code Here

    if (!isHttpAllowed(moduleName, actionName)) {
      if (!isSecure(request)) {
        // se est� a tentar aceder por http, removo o utilizador da sess�o
        request.getSession().remove(parameters.getString("session.user.tag", "user"));
        throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
      }

      return;
    }

    throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
  }
View Full Code Here

TOP

Related Classes of pt.opensoft.webmvc.action.NotAllowedException

Copyright © 2018 www.massapicom. 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.