wicket.protocol.http.request
Class WebExternalResourceRequestTarget

java.lang.Object
  extended by wicket.protocol.http.request.WebExternalResourceRequestTarget
All Implemented Interfaces:
IRequestTarget

public class WebExternalResourceRequestTarget
extends java.lang.Object
implements IRequestTarget

Request target that is not a Wicket resource. For example, such a resource could denote an image in the web application directory (not mapped to a Wicket servlet). NOTE: this target can only be used in a servlet environment with WebRequestCycles.

Author:
Eelco Hillenius

Constructor Summary
WebExternalResourceRequestTarget(java.lang.String url)
          Construct.
 
Method Summary
 void detach(RequestCycle requestCycle)
          This method is alled on the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getLock(RequestCycle requestCycle)
          Gets the lock to be used for synchronization.
 java.lang.String getUrl()
          Gets the url to the external resource.
 int hashCode()
           
 void respond(RequestCycle requestCycle)
          Respond by trying to delegate getting the resource from the ServletContext object and stream that to the client.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebExternalResourceRequestTarget

public WebExternalResourceRequestTarget(java.lang.String url)
Construct.

Parameters:
url - the relative url of the external resource
Method Detail

respond

public void respond(RequestCycle requestCycle)
Respond by trying to delegate getting the resource from the ServletContext object and stream that to the client. If such a resource is not found, a warning will be logged, and a 404 will be issued.

Specified by:
respond in interface IRequestTarget
Parameters:
requestCycle - the current request cycle
See Also:
IRequestTarget.respond(wicket.RequestCycle)

getUrl

public final java.lang.String getUrl()
Gets the url to the external resource.

Returns:
the url to the external resource

detach

public void detach(RequestCycle requestCycle)
Description copied from interface: IRequestTarget
This method is alled on the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.

Specified by:
detach in interface IRequestTarget
Parameters:
requestCycle - the current request cycle
See Also:
IRequestTarget.detach(wicket.RequestCycle)

getLock

public java.lang.Object getLock(RequestCycle requestCycle)
Description copied from interface: IRequestTarget
Gets the lock to be used for synchronization.

Specified by:
getLock in interface IRequestTarget
Parameters:
requestCycle - the current request cycle
Returns:
Any lock to be used to synchronize this target or null if no synchronization is needed.
See Also:
IRequestTarget.getLock(RequestCycle)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2007 Wicket developers. All Rights Reserved.