Package javax.portlet

Examples of javax.portlet.ActionRequest


    }


    public void changePassword(ActionFormEvent event) throws PortletException {
        log.debug("Entering changePassword");
        ActionRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();

        String username = req.getParameter("username");
        String currentPassword = req.getParameter("password0");
        String newPassword     = req.getParameter("password1");
        String newPasswordVerify = req.getParameter("password2");

        if ( isBlank(username) ) {
            res.setRenderParameter("errorMessage",
                "Username must not be blank");
            return ;
View Full Code Here


    if (logger.isDebugEnabled()) {
      logger.debug("Bound action request context to thread: " + request);
    }

    ActionRequest processedRequest = request;
    HandlerExecutionChain mappedHandler = null;
    int interceptorIndex = -1;

    try {
      processedRequest = checkMultipart(request);
View Full Code Here

    }
  }
 
  public void testActionRequestNotHandled() throws Exception {
    ParameterizableViewController controller = new ParameterizableViewController();
    ActionRequest request = new MockActionRequest();
    ActionResponse response = new MockActionResponse();
    try {
      controller.handleActionRequest(request, response);
      fail("should have thrown PortletException");
    }
View Full Code Here

    if (logger.isDebugEnabled()) {
      logger.debug("Bound action request context to thread: " + request);
    }

    ActionRequest processedRequest = request;
    HandlerExecutionChain mappedHandler = null;
    int interceptorIndex = -1;

    try {
      processedRequest = checkMultipart(request);
View Full Code Here

    @Test
    public void testActionPortletRequest() throws NoSuchFieldException,
            IllegalAccessException    {
        ApplicationContext applicationContext = createMock(ApplicationContext.class);
        PortletContext portletContext = createMock(PortletContext.class);
        ActionRequest request = createMock(ActionRequest.class);
        ActionResponse response = createMock(ActionResponse.class);

        replay(applicationContext, portletContext, request, response);
        ActionPortletRequest req = new ActionPortletRequest(applicationContext,
                portletContext, request, response);
View Full Code Here

     * methods that allow easier connection to those objects since the servlet
     * API doesn't provide those methods directly.
     */
    public ActionRequest getServletRequest(ActionRequest request)
    throws IOException, MultipartException {
        ActionRequest req = request;
        String contentType = request.getContentType();

        if ((contentType != null) && (contentType.toLowerCase().indexOf("multipart/form-data") > -1)) {
            if (request.getContentLength() > maxUploadSize) {
                throw new IOException("Content length exceeds maximum upload size.");
View Full Code Here

        // add the cocoon header timestamp
        res.setProperty("X-Cocoon-Version", Constants.VERSION);

        // get the request (wrapped if contains multipart-form data)
        ActionRequest request;
        try {
            if (this.enableUploads) {
                request = requestFactory.getServletRequest(req);
            } else {
                request = req;
            }
        } catch (Exception e) {
            if (getLogger().isErrorEnabled()) {
                getLogger().error("Problem with Cocoon portlet", e);
            }

            manageException(req, res, null, null,
                            "Problem in creating the Request", null, null, e);
            return;
        }

        // Get the cocoon engine instance
        getCocoon(request.getParameter(Constants.RELOAD_PARAM));

        // Check if cocoon was initialized
        if (this.cocoon == null) {
            manageException(request, res, null, null,
                            "Initialization Problem",
                            null /* "Cocoon was not initialized" */,
                            null /* "Cocoon was not initialized, cannot process request" */,
                            this.exception);
            return;
        }

        // We got it... Process the request
        String servletPath = this.servletPath;
        if (servletPath == null) {
            servletPath = "portlets/" + getPortletConfig().getPortletName() + '/';
        }

        String uri = servletPath;
        String pathInfo = request.getParameter(PortletEnvironment.PARAMETER_PATH_INFO);
        if (pathInfo != null) {
            if (pathInfo.length() > 0 && pathInfo.charAt(0) == '/') {
                pathInfo = pathInfo.substring(1);
            }
            uri += pathInfo;
View Full Code Here

        _isActionRequest = (portletRequest != null &&
                                 portletRequest instanceof ActionRequest);

        if (_isActionRequest)
        {
            ActionRequest actionRequest = (ActionRequest)portletRequest;

            // try to set character encoding as described in section 2.5.2.2 of JSF 1.1 spec
            try
            {
                String contentType = portletRequest.getProperty("Content-Type");

                String characterEncoding = lookupCharacterEncoding(contentType);

                if (characterEncoding == null) {
                    PortletSession session = portletRequest.getPortletSession(false);

                    if (session != null) {
                        characterEncoding = (String) session.getAttribute(ViewHandler.CHARACTER_ENCODING_KEY,
                                                                          PortletSession.PORTLET_SCOPE);
                    }

                    if (characterEncoding != null) {
                        actionRequest.setCharacterEncoding(characterEncoding);
                    }
                }
            } catch (Exception e)
            {
                if (log.isWarnEnabled())
View Full Code Here

    // This tests that we can encode a new mode in an actionURL
    // done by navigation rule.
    if (BridgeUtil.getPortletRequestPhase() ==
        Bridge.PortletPhase.ACTION_PHASE)
    {
      ActionRequest aRequest =
        new ActionRequestDecorator((ActionRequest) extCtx.getRequest());

      extCtx.setRequest(aRequest);
      if (extCtx.getRequest() == aRequest)
      {
View Full Code Here

    ExternalContext extCtx = ctx.getExternalContext();

    if (BridgeUtil.getPortletRequestPhase() ==
        Bridge.PortletPhase.ACTION_PHASE)
    {
      ActionRequest actionRequest = (ActionRequest) extCtx.getRequest();
      String charEncoding = extCtx.getRequestCharacterEncoding();
      String actionCharEncoding = actionRequest.getCharacterEncoding();
      if ((charEncoding == null && actionCharEncoding == null) ||
          charEncoding.equals(actionCharEncoding))
      {
        testRunner.setTestResult(true,
                                 "extCtx.getRequestCharacterEncoding() correctly returned the same value as actionRequest.getCharacterEncoding()");
View Full Code Here

TOP

Related Classes of javax.portlet.ActionRequest

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.