MyFaces Core
  1. MyFaces Core
  2. MYFACES-2083

FacesContext contains several unnecessary methods

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: 2.0.0-alpha
    • Component/s: JSR-314
    • Labels:
      None

      Description

      Several fields and methods are currently put in FacesContext, but should (according to the JSF 2.0 spec) be placed inside another class: PartialViewContext.

      They are:
      public static final String NO_PARTIAL_PHASE_CLIENT_IDS = "none";
      public static final String PARTIAL_EXECUTE_PARAM_NAME = "javax.faces.partial.execute";
      public static final String PARTIAL_RENDER_PARAM_NAME = "javax.faces.partial.render";

      public List<String> getExecutePhaseClientIds()
      public ResponseWriter getPartialResponseWriter()
      public List<String> getRenderPhaseClientIds()
      public void setExecutePhaseClientIds(List<String> executePhaseClientIds)
      public void setRenderAll(boolean renderAll)
      public void setRenderPhaseClientIds(List<String> renderPhaseClientIds)
      public boolean isAjaxRequest()
      public boolean isExecuteNone()
      public boolean isPostback()
      public boolean isRenderAll()
      public boolean isRenderNone()

      1. FacesContext20.patch
        15 kB
        Jan-Kees van Andel

        Issue Links

          Activity

          Hide
          Jan-Kees van Andel added a comment -

          Attached the new class, should be ready to use.

          Show
          Jan-Kees van Andel added a comment - Attached the new class, should be ready to use.
          Hide
          Jan-Kees van Andel added a comment -

          This patch contains the fixed FacesContext. It also contains all other methods that were added in JSF 2.0.

          The PartialViewContext class is also provided, since otherwise it would not compile.

          Show
          Jan-Kees van Andel added a comment - This patch contains the fixed FacesContext. It also contains all other methods that were added in JSF 2.0. The PartialViewContext class is also provided, since otherwise it would not compile.
          Hide
          Werner Punz added a comment -

          When was this split in contexts added?
          The last public draft from 2 months ago had everything in the FacesContext.
          And that was the reference state the TODOs were added!!!

          Can anyone do a quick lookup in the latest RI code?

          Werner

          Show
          Werner Punz added a comment - When was this split in contexts added? The last public draft from 2 months ago had everything in the FacesContext. And that was the reference state the TODOs were added!!! Can anyone do a quick lookup in the latest RI code? Werner
          Hide
          Jan-Kees van Andel added a comment -

          I think it was added in EDR 2, since I downloaded the latest JavaDocs from the JSR 314 site.

          The JavaDocs specified a PartialViewContext class, which is accessible from FacesContext#getPartialViewContext(). This method (creates and) returns the PartialViewContext for this request.

          Show
          Jan-Kees van Andel added a comment - I think it was added in EDR 2, since I downloaded the latest JavaDocs from the JSR 314 site. The JavaDocs specified a PartialViewContext class, which is accessible from FacesContext#getPartialViewContext(). This method (creates and) returns the PartialViewContext for this request.
          Hide
          Werner Punz added a comment -

          Ok thanks Jan

          I will clear this up when I am going to start to merge the patches, which will be hopefully depending on the CLI/CLA situation of yours by tomorrow.

          Werner

          Show
          Werner Punz added a comment - Ok thanks Jan I will clear this up when I am going to start to merge the patches, which will be hopefully depending on the CLI/CLA situation of yours by tomorrow. Werner
          Hide
          Leonardo Uribe added a comment -

          Added getExceptionHandler and setExceptionHandler (it should throw UnsupportedOperationException by default as other FacesContext methods and on impl it should do something similar to getRenderKit(), in other words use ExceptionHandlerFactory and hold the factory as variable) for solve MYFACES-2093.

          Show
          Leonardo Uribe added a comment - Added getExceptionHandler and setExceptionHandler (it should throw UnsupportedOperationException by default as other FacesContext methods and on impl it should do something similar to getRenderKit(), in other words use ExceptionHandlerFactory and hold the factory as variable) for solve MYFACES-2093 .
          Hide
          Simon Lessard added a comment -

          Applied the patch to the branch including FacesContextImpl changes to reflect the new API. However there are still methods to implement in there like getPartialResponseWriter and getPartialViewContext.

          Revision 732562, thank you for your contribution.

          Show
          Simon Lessard added a comment - Applied the patch to the branch including FacesContextImpl changes to reflect the new API. However there are still methods to implement in there like getPartialResponseWriter and getPartialViewContext. Revision 732562, thank you for your contribution.

            People

            • Assignee:
              Simon Lessard
              Reporter:
              Jan-Kees van Andel
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development