org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation
Class DefaultWindowHandler

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultWindowHandler
All Implemented Interfaces:
Serializable, WindowHandler
Direct Known Subclasses:
ClientSideWindowHandler, ServerSideWindowHandler

@ApplicationScoped
public class DefaultWindowHandler
extends Object
implements WindowHandler

See Also:
Serialized Form

Field Summary
protected  boolean useWindowAwareUrlEncoding
           
 
Constructor Summary
protected DefaultWindowHandler()
           
protected DefaultWindowHandler(WindowContextConfig config)
           
 
Method Summary
protected  String addWindowIdIfNecessary(String url, String windowId)
           
 String createWindowId()
          Creates a new and unique window-id for the current user-session
 String encodeURL(String url)
          Allows to intercept the URL encoding
protected  String getCurrentWindowId()
           
 String restoreWindowId(javax.faces.context.ExternalContext externalContext)
          Allows to restore the window-id depending on the window-strategy supported by the implementation
 void sendRedirect(javax.faces.context.ExternalContext externalContext, String url, boolean addRequestParameter)
          Allows to intercept redirects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useWindowAwareUrlEncoding

protected boolean useWindowAwareUrlEncoding
Constructor Detail

DefaultWindowHandler

protected DefaultWindowHandler()

DefaultWindowHandler

@Inject
protected DefaultWindowHandler(WindowContextConfig config)
Method Detail

encodeURL

public String encodeURL(String url)
Allows to intercept the URL encoding

Specified by:
encodeURL in interface WindowHandler
Parameters:
url - URL which has to be encoded
Returns:
the changed URL

sendRedirect

public void sendRedirect(javax.faces.context.ExternalContext externalContext,
                         String url,
                         boolean addRequestParameter)
                  throws IOException
Allows to intercept redirects

Specified by:
sendRedirect in interface WindowHandler
Parameters:
externalContext - current external-context
url - current URL
addRequestParameter - flag which indicates if the request-parameters should be added to the URL
Throws:
IOException - exception which might be thrown by the external-context during the redirect

createWindowId

public String createWindowId()
Creates a new and unique window-id for the current user-session

Specified by:
createWindowId in interface WindowHandler
Returns:
valid window-id

restoreWindowId

public String restoreWindowId(javax.faces.context.ExternalContext externalContext)
Allows to restore the window-id depending on the window-strategy supported by the implementation

Specified by:
restoreWindowId in interface WindowHandler
Parameters:
externalContext - current external-context
Returns:
extracted window-id, null otherwise

getCurrentWindowId

protected String getCurrentWindowId()

addWindowIdIfNecessary

protected String addWindowIdIfNecessary(String url,
                                        String windowId)


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.