great!

i didn't think it was THAT easy. 
i spend a whole day to find an answer to this, but was looking at the wrong 
places.

thank you

-------- Original-Nachricht --------
> Datum: Thu, 27 Nov 2008 11:06:31 -0500
> Von: Michael O\'Cleirigh <[EMAIL PROTECTED]>
> An: users@wicket.apache.org
> Betreff: Re: getting ip address from URIRequestTargetUrlCodingStrategy

> Hi Stefan,
> 
> You can get the IP address that sent the request like this:
> 
> WebRequest wr = (WebRequest) RequestCycle.get().getRequest();
> 
> String originatingIPAddress  = wr.getHttpServletRequest().getRemoteHost();
> 
> You can probably place it directly in the decode(...) method of your url 
> coding strategy.
> 
> Regards,
> 
> Mike
> 
> > in my webapp i want to serve files from the filesystem to the user. so i
> coded something like this:
> >
> > mount(new URIRequestTargetUrlCodingStrategy("/files") {
> >             @Override
> >             public IRequestTarget decode(RequestParameters
> requestParameters) {
> >   
> >         final String fileId = getURI(requestParameters);
> >
> > ... read some info from database and build a fileInfo object ...
> >
> >                 /* Get file for this instance */
> >                 return new ResourceStreamRequestTarget(new
> AnonFileResourceStream(fileInfo));
> >             }
> >         });
> >
> > (AnonFileResourceStream extends AbstractResourceStream)
> >
> > all requests to "/files" use the remaining part of the request to ask
> the database where the real file is located and stream it to the client. 
> > the problem is that i need to know from which ip address the request was
> made. i need the WebRequest object for this request to get some http
> headers. 
> > is this possible or is there another way to get hold of this
> information?
> >
> >
> > thanx alot
> > stefan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to