Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3042

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

        Hide
        mike_freedman 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
        mike_freedman 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.
        Hide
        mkienenb Mike Kienenberger added a comment -

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

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

        Modifies file to be servlet independent.

        Show
        mike_freedman Michael Freedman added a comment - Modifies file to be servlet independent.
        Hide
        mike_freedman 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
        mike_freedman 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.
        Hide
        lu4242 Leonardo Uribe added a comment -

        Thanks to Michael Freedman for provide this patch

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development