Examples of PortletSessionRequiredException


Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

    }
   
    // Session-form mode: retrieve form object from portlet session attribute.
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Must have session when trying to bind (in session-form mode)");
    }
    String formAttrName = getFormSessionAttributeName(request);
    Object sessionFormObject = session.getAttribute(formAttrName);
    if (sessionFormObject == null) {
      throw new PortletSessionRequiredException("Form object not found in session (in session-form mode)");
    }

    // Remove form object from porlet session: we might finish the form workflow
    // in this request. If it turns out that we need to show the form view again,
    // we'll re-bind the form object to the portlet session.
    if (logger.isDebugEnabled()) {
      logger.debug("Removing form session attribute [" + formAttrName + "]");
    }
    session.removeAttribute(formAttrName);

    // Check the command object to make sure its valid
    if (!checkCommand(sessionFormObject)) {
      throw new PortletSessionRequiredException("Object found in session does not match commandClass");
    }

    return sessionFormObject;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

   * @see #setRenderCommandAndErrors
   */
  protected final Object getRenderCommand(RenderRequest request) throws PortletException {
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Could not obtain portlet session");
    }
    Object command = session.getAttribute(getRenderCommandSessionAttributeName());
    if (command == null) {
      throw new PortletSessionRequiredException("Could not obtain command object from portlet session");
    }
    return command;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

   * @see #setRenderCommandAndErrors
   */
  protected final BindException getRenderErrors(RenderRequest request) throws PortletException {
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Could not obtain portlet session");
    }
    BindException errors = (BindException) session.getAttribute(getRenderErrorsSessionAttributeName());
    if (errors == null) {
      throw new PortletSessionRequiredException("Could not obtain errors object from portlet session");
    }
    return errors;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

    }
   
    // Session-form mode: retrieve form object from portlet session attribute.
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Must have session when trying to bind (in session-form mode)");
    }
    String formAttrName = getFormSessionAttributeName(request);
    Object sessionFormObject = session.getAttribute(formAttrName);
    if (sessionFormObject == null) {
      throw new PortletSessionRequiredException("Form object not found in session (in session-form mode)");
    }

    // Remove form object from porlet session: we might finish the form workflow
    // in this request. If it turns out that we need to show the form view again,
    // we'll re-bind the form object to the portlet session.
    if (logger.isDebugEnabled()) {
      logger.debug("Removing form session attribute [" + formAttrName + "]");
    }
    session.removeAttribute(formAttrName);

    // Check the command object to make sure its valid
    if (!checkCommand(sessionFormObject)) {
      throw new PortletSessionRequiredException("Object found in session does not match commandClass");
    }

    return sessionFormObject;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

      throw new MissingPortletRequestParameterException(paramName, paramType.getSimpleName());
    }

    @Override
    protected void raiseSessionRequiredException(String message) throws Exception {
      throw new PortletSessionRequiredException(message);
    }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

    }
   
    // Session-form mode: retrieve form object from portlet session attribute.
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Must have session when trying to bind (in session-form mode)");
    }
    String formAttrName = getFormSessionAttributeName(request);
    Object sessionFormObject = session.getAttribute(formAttrName);
    if (sessionFormObject == null) {
      throw new PortletSessionRequiredException("Form object not found in session (in session-form mode)");
    }

    // Remove form object from porlet session: we might finish the form workflow
    // in this request. If it turns out that we need to show the form view again,
    // we'll re-bind the form object to the portlet session.
    if (logger.isDebugEnabled()) {
      logger.debug("Removing form session attribute [" + formAttrName + "]");
    }
    session.removeAttribute(formAttrName);

    // Check the command object to make sure its valid
    if (!checkCommand(sessionFormObject)) {
      throw new PortletSessionRequiredException("Object found in session does not match commandClass");
    }

    return sessionFormObject;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

   * @see #setRenderCommandAndErrors
   */
  protected final Object getRenderCommand(RenderRequest request) throws PortletException {
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Could not obtain portlet session");
    }
    Object command = session.getAttribute(getRenderCommandSessionAttributeName());
    if (command == null) {
      throw new PortletSessionRequiredException("Could not obtain command object from portlet session");
    }
    return command;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

   * @see #setRenderCommandAndErrors
   */
  protected final BindException getRenderErrors(RenderRequest request) throws PortletException {
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Could not obtain portlet session");
    }
    BindException errors = (BindException) session.getAttribute(getRenderErrorsSessionAttributeName());
    if (errors == null) {
      throw new PortletSessionRequiredException("Could not obtain errors object from portlet session");
    }
    return errors;
  }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

      throw new MissingPortletRequestParameterException(paramName, paramType.getName());
    }

    @Override
    protected void raiseSessionRequiredException(String message) throws Exception {
      throw new PortletSessionRequiredException(message);
    }
View Full Code Here

Examples of org.springframework.web.portlet.handler.PortletSessionRequiredException

   * @see #setRenderCommandAndErrors
   */
  protected final Object getRenderCommand(RenderRequest request) throws PortletException {
    PortletSession session = request.getPortletSession(false);
    if (session == null) {
      throw new PortletSessionRequiredException("Could not obtain portlet session");
    }
    Object command = session.getAttribute(getRenderCommandSessionAttributeName());
    if (command == null) {
      throw new PortletSessionRequiredException("Could not obtain command object from portlet session");
    }
    return command;
  }
View Full Code Here
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.