Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.11-core
    • Fix Version/s: 1.2.11-core
    • Component/s: Portlet
    • Labels:
      None

      Description

      The method ExternalContextUtils.isAction(final ExternalContext externalContext) does not reliably detect an action request.
      If the object returned by ExternalContext.getRequest() implements the ServletRequest interface the method above returns
      true. This can also apply for a RenderRequest which is not an ActionRequest.

      The following fixes this:

      /**

      • Returns <code>true</code> if this externalContext represents an "action". An action request
      • is any ServletRequest or a portlet ActionRequest. It is assumed that the ExternalContext
        *
      • @return a boolean of <code>true</code> if this is a Portlet ActionRequest or an non-portlet
      • request.
        */
        public static boolean isAction(final ExternalContext externalContext)
        {
        final Object request = externalContext.getRequest();

      if (_PORTLET_ACTION_REQUEST_CLASS == null)

      { _LOG .fine("Portlet API's are not on the classpath so isAction will only check for servlet request."); return request instanceof ServletRequest; }

      return (request instanceof ServletRequest && !_PORTLET_RENDER_REQUEST_CLASS.isInstance(request) ||
      _PORTLET_ACTION_REQUEST_CLASS.isInstance(request)) ;
      }

      _PORTLET_RENDER_REQUEST_CLASS has to be properly initialized. Not sure why this method checks for ServletRequest.

      1. TRINIDAD-1377-patch.txt
        4 kB
        Felix Röthenbacher

        Issue Links

          Activity

          Matthias Weßendorf made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Scott O'Bryan made changes -
          Resolution Fixed [ 1 ]
          Fix Version/s  1.2.11-core [ 12313510 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Scott O'Bryan made changes -
          Link This issue is part of TRINIDAD-1376 [ TRINIDAD-1376 ]
          Scott O'Bryan made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Scott O'Bryan made changes -
          Assignee Scott O'Bryan [ darkarena ]
          Felix Röthenbacher made changes -
          Attachment TRINIDAD-1377-patch.txt [ 12398787 ]
          Felix Röthenbacher made changes -
          Status Reopened [ 4 ] Patch Available [ 10002 ]
          Scott O'Bryan made changes -
          Status Closed [ 6 ] Reopened [ 4 ]
          Resolution Invalid [ 6 ]
          Scott O'Bryan made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Invalid [ 6 ]
          Felix Röthenbacher made changes -
          Status Closed [ 6 ] Reopened [ 4 ]
          Resolution Won't Fix [ 2 ]
          Scott O'Bryan made changes -
          Field Original Value New Value
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Won't Fix [ 2 ]
          Felix Röthenbacher created issue -

            People

            • Assignee:
              Scott O'Bryan
              Reporter:
              Felix Röthenbacher
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development