Package javax.portlet

Examples of javax.portlet.ActionRequest


        //res.getWriter().print("Rendering: Portlet Class = " + entity.getPortletClass() + "<BR/>");

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

            portlet.processAction(actionRequest, actionResponse);
        }
        else if (method == ContainerConstants.METHOD_RENDER)
View Full Code Here


    public void setPreferenceTwo(String preferenceTwo) {
        this.preferenceTwo = preferenceTwo;
    }
   
    public String execute() throws Exception {
        ActionRequest req = PortletActionContext.getActionRequest();
        PortletPreferences prefs = req.getPreferences();
        prefs.setValue("preferenceOne", preferenceOne);
        prefs.setValue("preferenceTwo", preferenceTwo);
        prefs.store();
        return SUCCESS;
    }
View Full Code Here

   public int doEndTag() throws JspException
   {
      RenderRequest rreq = getRenderRequest();
      RenderResponse rresp = getRenderResponse();
      ActionRequest areq = getActionRequest();
      ActionResponse aresp = getActionResponse();
      EventRequest ereq = getEventRequest();
      EventResponse eresp = getEventResponse();
      ResourceRequest rsreq = getResourceRequest();
      ResourceResponse rsresp = getResourceResponse();
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

            portletName = (String)request.getAttribute(ContainerConstants.PORTLET_NAME);
            request.removeAttribute(ContainerConstants.PORTLET);

            if (method == ContainerConstants.METHOD_ACTION)
            {
                ActionRequest actionRequest = (ActionRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
                ActionResponse actionResponse = (ActionResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
                // inject the current request into the actionRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)actionRequest).getRequest()).setRequest(request);

                portlet.processAction(actionRequest, actionResponse);
View Full Code Here


      //Action only
      if (actionCount == 1 && eventCount == 0)
      {
         ActionRequest actionRequest = (ActionRequest)portletRequest;

         //SPEC:248
         try
         {
            // request was already read
            request.setCharacterEncoding("utf8");
            assertTrue(false);
         }
         catch (IllegalStateException e)
         {
            //expected
         }
         assertEquals(actionRequest.getCharacterEncoding(), request.getCharacterEncoding());
         assertEquals(actionRequest.getContentType(), request.getContentType());
         //TODO: How to check if its the same behaviour as in PR? Its not the same object.
         assertNotNull(request.getInputStream());
         assertEquals(actionRequest.getContentLength(), request.getContentLength());
         assertEquals(actionRequest.getMethod(), request.getMethod());
         // Underlaying impl invoke getImputStream so cannot test in single request
         //assertEquals(actionRequest.getReader(), request.getReader());
      }

      //Event only
View Full Code Here


      //Action only
      if (actionCount == 1 && eventCount == 0)
      {
         ActionRequest actionRequest = (ActionRequest)portletRequest;

         //SPEC:190
         try
         {
            // request was already read
            request.setCharacterEncoding("utf8");
            assertTrue(false);
         }
         catch (IllegalStateException e)
         {
            //expected
         }
         assertEquals(actionRequest.getCharacterEncoding(), request.getCharacterEncoding());
         assertEquals(actionRequest.getContentType(), request.getContentType());
         //TODO: How to check if its the same behaviour as in PR? Its not the same object.
         assertNotNull(request.getInputStream());
         assertEquals(actionRequest.getContentLength(), request.getContentLength());
         assertEquals(actionRequest.getMethod(), request.getMethod());
         // Underlaying impl invoke getImputStream so cannot test in single request
         //assertEquals(actionRequest.getReader(), request.getReader());
      }

      //Event only
View Full Code Here

            Portlet portlet = (Portlet)request.getAttribute(ContainerConstants.PORTLET);
            request.removeAttribute(ContainerConstants.PORTLET);

            if (method == ContainerConstants.METHOD_ACTION)
            {
                ActionRequest actionRequest = (ActionRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
                ActionResponse actionResponse = (ActionResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
                // inject the current request into the actionRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)actionRequest).getRequest()).setRequest(request);

                portlet.processAction(actionRequest, actionResponse);
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

      if (clientDataRequest instanceof ResourceRequest) {
        ResourceRequest resourceRequest = (ResourceRequest) clientDataRequest;
        fileItemIterator = portletFileUpload.getItemIterator(new ActionRequestAdapter(resourceRequest));
      }
      else {
        ActionRequest actionRequest = (ActionRequest) clientDataRequest;
        fileItemIterator = portletFileUpload.getItemIterator(actionRequest);
      }

      boolean optimizeNamespace = PortletConfigParam.OptimizePortletNamespace.getBooleanValue(portletConfig);
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.