Announcement Announcement Module
Collapse
No announcement yet.
FacesContext and other stuff in Spring Web Flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FacesContext and other stuff in Spring Web Flow

    Hello Everybody,

    I have a question about JSF's APIs in SWF.
    I try to access
    Code:
    FacesCotext.getCurrentInstance()
    from action methods but everywhere it return null.
    Only when i implement PhaseListener i found out that JSF pass only 2 phases
    1.RestoreView
    2.RenderResponse
    instead of normal 6.

    And in RenderResponse the FacesContext have a normal value and i can get even
    FacesContext.getCurrentInstance().getViewRoot() object to add/remove UIComponents to runtime Component tree or just manipulate values in it.
    But in most cases it useful to access that objects from actions to manipulate something in action depends on other stuff
    So HOW can i access that Objects - FacesContext,ExternalContext,ViewRoot etc. from Actions ?

  • #2
    Today I found out that all JSF phases invoked during request , only first time as it have to be invoked only 2 phases..so after integration JSF and SWF, JSF Phases invoked normal , but can somebody tell me what exactly going on , and what happened in that phases, cos how I understand JSF have nothing to do here, it only have to render view...

    and also when SWF action invoked? in some of JSF phase ? and where is facesContext when Action invoked..?

    Comment


    • #3
      SWF is invoked after the INVOKE APPLICATION phase, only when a JSF user event maps to a Web Flow event. A FacesContext is not available at that time. In general, JSF's scope is local to render and user event processing inside a ViewState.

      Keith

      Comment


      • #4
        Hello Keith,

        Thank you for your fast reply , it's now clear to me how integration work's , so it's possible to use all JSF features in this integration , except actions and navigations which are wrapped and locked by SWF am I right?

        and also , There is a good Feature in JSF in navigation rules - </redirect> that helps to bookmark url , is there anything like this in SWF, and how the bookmark problem solved in SWF?

        Thanks and Regards,
        Tigran.

        Comment


        • #5
          I don't think SWF supports bookmarking of pages, at least, pages rendered as a view-state. SWF is all about controlling the navigational flow of an application, and the best way to ensure that the server-side and client-side states stay in sync is to prevent arbitrary invocation of states. Bookmarking in this manner is an arbitrary invocation of a view-state.

          That said, I'm not sure if anything's changed to support this since version 2.0.3, or if anything is being planned to support this in version 3.0.0.

          Comment


          • #6
            you can bookmark a flow definition url; book marking a flow execution url doesn't make any sense.

            Comment


            • #7
              Thank you all,
              see you in next threads

              Comment

              Working...
              X