Package javax.portlet

Examples of javax.portlet.ActionRequest


        _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


    url.setParameter(VIEW_ID, viewId);
    return url.toString();
  }

  public static void ensureEncoding(FacesContext facesContext) throws UnsupportedEncodingException {
    ActionRequest request = (ActionRequest) facesContext.getExternalContext().getRequest();
    if (request.getCharacterEncoding() == null) {
      request.setCharacterEncoding("UTF-8");
    }
  }
View Full Code Here

        }

        String location = null;

        InternalActionResponse _actionResponse = null;
        ActionRequest actionRequest = null;

        try
        {
            /*ActionRequest*/
            actionRequest =
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

        _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

        _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

        _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

        // 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;
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",
View Full Code Here

            Thread.currentThread().setContextClassLoader(paClassLoader);

        if (method == ContainerConstants.METHOD_ACTION)
        {
            ActionRequest actionRequest = (ActionRequest)portletRequest;           
            ActionResponse actionResponse = (ActionResponse)portletResponse;

                portletInstance.processAction(actionRequest, actionResponse);
        }
        else if (method == ContainerConstants.METHOD_RENDER)
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.