MyFaces Core
  1. MyFaces Core
  2. MYFACES-3042

CCE: when running in portlet: Remove Servlet dependencies in FaceletViewDeclarationLanguage.java

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5-SNAPSHOT
    • Fix Version/s: 2.0.5
    • Component/s: Portlet_Support
    • Labels:
      None

      Description

      In FaceletViewDeclarationLanguage.java: createResponseWriter(), getResponseEncoding(), handleFaceletNotFound(), and sendSourceNotFound() each cast to Servlet object. This causes ClassCastExceptions when run in a portlet environment. Each of these calls/casts can be removed and ExternalContext APIs can be used instead to get/set the needed information from the request or response object.

        Activity

        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Leonardo Uribe made changes -
        Fix Version/s 2.0.5 [ 12316346 ]
        Fix Version/s 2.0.5-SNAPSHOT [ 12316168 ]
        Leonardo Uribe made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 2.0.5-SNAPSHOT [ 12316168 ]
        Resolution Fixed [ 1 ]
        Hide
        Leonardo Uribe added a comment -

        Thanks to Michael Freedman for provide this patch

        Show
        Leonardo Uribe added a comment - Thanks to Michael Freedman for provide this patch
        Hide
        Michael Freedman added a comment -

        I have attached a potential patch – Apologies for not just making the changes but (1) this change breaks an automated test that is part of the build as it seems the test environment doesn't provide its own stub impl of the new JSF 2.0 ExternalContext methods that these changes rely on – and I have no clue how to address those and (2) the various paperwork Oracle made me sign to allow me to participate in Apache only allows me to submit work related to the Portlet Bridge project – MyFaces work has to be submitted by those from Oracle signed up to do that.

        Show
        Michael Freedman added a comment - I have attached a potential patch – Apologies for not just making the changes but (1) this change breaks an automated test that is part of the build as it seems the test environment doesn't provide its own stub impl of the new JSF 2.0 ExternalContext methods that these changes rely on – and I have no clue how to address those and (2) the various paperwork Oracle made me sign to allow me to participate in Apache only allows me to submit work related to the Portlet Bridge project – MyFaces work has to be submitted by those from Oracle signed up to do that.
        Michael Freedman made changes -
        Attachment jira-myfaces-3042.patch [ 12471089 ]
        Hide
        Michael Freedman added a comment -

        Modifies file to be servlet independent.

        Show
        Michael Freedman added a comment - Modifies file to be servlet independent.
        Michael Freedman made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Mike Kienenberger added a comment -

        Michael, you should have permissions to fix this yourself if you desire.

        Show
        Mike Kienenberger added a comment - Michael, you should have permissions to fix this yourself if you desire.
        Hide
        Michael Freedman added a comment -

        FYI ... when you make these changes it looks like you will also have to implement an ExternalContext (stub) to use in the test harness as one doesn't seem to exist at the moment – and these new 2.0 methods through an exception (from the javax.faces.context impl) if not implemented.

        Show
        Michael Freedman added a comment - FYI ... when you make these changes it looks like you will also have to implement an ExternalContext (stub) to use in the test harness as one doesn't seem to exist at the moment – and these new 2.0 methods through an exception (from the javax.faces.context impl) if not implemented.
        Michael Freedman created issue -

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Michael Freedman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development