I've read in JSF docs that ResponseStateManager
has a isPostBack()
method. How (and where) can I have an instance of ResponseStateManager
?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- java.lang.NullPointerException at java.io.PrintWri
- h:selectOneMenu in p:dataTable doesn't submit
- PrimeFaces block UI does not work when the compone
- primefaces orderlist not getting updated with the
相关文章
- How to allow numbers only using f:validateRegex
- JSF 2.0: ajax request when press ENTER
- Formatting a double in JSF
- After postback my JavaScript function doesn't
- f:convertNumber on Double: ClassCastException
- SeamPhaseListener - Could not start transaction -
- How do I access EJB bean when inside a custom Conv
- Getting value from dynamically created inputText
Depends on JSF version.
In JSF 1.0/1.1, there's no
ResponseStateManager#isPostback()
method available. check ifjavax.faces.ViewState
parameter is present in the request parameter map as available byExternalContext#getRequestParameterMap()
.In JSF 1.2, indeed use
ResponseStateManager#isPostback()
which in turn actually checks the presence ofjavax.faces.ViewState
parameter in the request parameter map.In JSF 2.0, instead use
FacesContext#isPostback()
, which under the covers actually delegates toResponseStateManager#isPostback()
.Indeed, before jsf1.2, isPostBack was obtained through the requestScope of the current instance of FaceContext.
Since JSF1.2, The ResponseStateManager (helper class to StateManager that knows the specific rendering technology being used to generate the response, a singleton abstract class, vended by the RenderKit.)
That article mentionned above (Creating and Using a Custom Render Kit) illustrates how to implement/get an ResponseStateManager, through a RenderKit (defined by the tag handler implementing the tag that renders the component).
May be this is enough for you to get your own ResponseStateManager in your context ?
For JSF1.2