org.apache.wicket.protocol.http.request
Class WebClientInfo

java.lang.Object
  extended by org.apache.wicket.request.ClientInfo
      extended by org.apache.wicket.protocol.http.request.WebClientInfo
All Implemented Interfaces:
Serializable, IClusterable

public class WebClientInfo
extends ClientInfo

Default client info object for web applications.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
WebClientInfo(WebRequestCycle requestCycle)
          Construct.
WebClientInfo(WebRequestCycle requestCycle, String userAgent)
          Construct.
 
Method Summary
 ClientProperties getProperties()
          Gets the client properties object.
protected  String getRemoteAddr(WebRequestCycle requestCycle)
          When using ProxyPass, requestCycle().getHttpServletRequest().
 String getUserAgent()
          Gets the user agent string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebClientInfo

public WebClientInfo(WebRequestCycle requestCycle)
Construct.

Parameters:
requestCycle - the request cycle

WebClientInfo

public WebClientInfo(WebRequestCycle requestCycle,
                     String userAgent)
Construct.

Parameters:
requestCycle - the request cycle
userAgent - the user agent
Method Detail

getProperties

public final ClientProperties getProperties()
Gets the client properties object.

Returns:
the client properties object

getUserAgent

public final String getUserAgent()
Gets the user agent string.

Returns:
the user agent string

getRemoteAddr

protected String getRemoteAddr(WebRequestCycle requestCycle)
When using ProxyPass, requestCycle().getHttpServletRequest(). getRemoteAddr() returns the IP of the machine forwarding the request. In order to maintain the clients ip address, the server places it in the X-Forwarded-For Header.

Parameters:
requestCycle - the request cycle
Returns:
remoteAddr IP address of the client, using the X-Forwarded-For header and defaulting to: getHttpServletRequest().getRemoteAddr()


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.