>VelocityViewServlet or VelocityLayoutServlet?
None of these in use

I give my "szenario" another try ;)
[HTTP REQUEST 1] enters
[HTTP REQUEST 1] starts writing to the  response.writer -> at a "certain buffer 
limit" the response is commited
[HTTP REQUEST 2] enters, gets "the same" (i.e. the recycled) Request as REQUEST 
1
[HTTP REQUEST 1] while still writing (renderig velocity template) 
"request.getRemoteAddress()" is being called 
[HTTP REQUEST 2] calls request.getRemoteAddress() <=== what address am I 
getting?

-----Ursprüngliche Nachricht-----
Von: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Gesendet: Dienstag, 11. März 2014 19:47
An: Tomcat Users List
Betreff: Re: AW: request.getRemoteAddr() sometimes returning IP address from 
the previous request

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Clemens,

On 3/11/14, 11:23 AM, Clemens Wyss DEV wrote:
> First of all: thanks for the quick replies! I appreciate very much.
> 
>> It would help if you told us which Tomcat version you were using.
> Tomcat 7.0.52, i.e. latest greatest
> 
>> (The reuse can be disabled via a system property, see 
>> RECYCLE_FACADES. I usually do so, for better security)
> Would I need to compile my own tomcat?
> 
>> Define what you mean by volatile.
> the members of the request object that are "recycled". To be
> honest, I have not yet looked into the tomcat sources.
> 
> To render we use velocity. The output is directly rendered into
> the response-writer. So the first byte written/rendered by velocity
> sets the response to commited (right?).

Not unless you have disabled all buffering.

Are you using any of the Velocity Tools stuff, like
VelocityViewServlet or VelocityLayoutServlet?

> AND yes we have templates which we access the
> request#getRemoteAddress ("somewhere close the end").

It should not matter. As long as you aren't storing the result of
request.remoteAddress anywhere, Velocity won't cache it anywhere.

> So could it be that these "accesses" set the remoteAddress tot he 
> caller oft he "previous request"?

This shouldn't happen. But if you play games with storing request
objects in various places, you could have a problem. This is why I
asked about using VelocityViewServlet. Did you roll your own Velocity
servlet? If so, you may have made a mistake building your
VelocityContext which ends up using the wrong request object.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTH1okAAoJEBzwKT+lPKRYXWYP+wcp8HQHyD7Wpcmq71JB4KPO
S8ivvxpku2NeRcY5v4s5CSfJ6zBbxaL8SYnSL+3nakECxIIUl0GrMZ6dGgVHS7/l
cYXhMNtXe7v5mEMJpo/koMA8lajkLtD3wTTKnaJCNkEbH00pEf6mySHxLIAocJ8G
IAMVTJXxJPHsuZEJr219o+OJ8j5xLbX1GQq1B27eo1eszIO09YgVrUfAzMwaCesy
3kysGiuWS52/2jvHWAm/nKwdSf+PqWX+6P6fCo7ofVdsPO0PMh+20D8eYRQIRfW2
uJGypEofH9APlWebjZrnEV8+tjUXkcK0J6CuFuvhzAwaxg3TUrOC/BjysxKulMH6
SR9E2cJZjXNB6L3gOXXX7KrFsZVElFI+jJ2HwW8yZBWCmRXnchZBwCuRJZFYOidw
N7Pmu8QtdwTIU+7iL5nM9zsUJvddVlIvzgTA7lLHVFk6QteiY4ZwqZAHMOGcpEVQ
LkKpUK4SB1QyIZjDtU1HpPFtD4bJKptPEKddTZZ9hJYs6nnWBouCs9XB5Y2zEYUs
zK2A+jjIMfqoxJBDfQllHmw4w7uDn6/cH3tp/3uRgEDDlFf326GwgufWw4l2WBN2
NAYJERfKPiYUuz2UC3MKnabuHi2J2vySyHA7jcjLnjMqs/x/+cEihBZ6QCO9LbPM
aYpgGu3bs8+BYbfgNErI
=k6ip
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to