[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: set environment variables in tomcat
From:       André_Warnier <aw () ice-sa ! com>
Date:       2011-06-02 10:47:00
Message-ID: 4DE76A24.2000006 () ice-sa ! com
[Download RAW message or body]

Kim Goldov wrote:
> Thanks everyone. Here is what I ended up with.
> 
> In my PerlHeaderParserHandler:
> 
>     $r->subprocess_env(AA_MYVAR => 'myvalue');
>     $r->subprocess_env();
> 
> In jk.conf:
> 
>     JkEnvVar      AA_MYVAR
> 
> In Tomcat:
> 
>       out.println("AA_MYVAR is: " + request.getAttribute("AA_MYVAR") );
> 

Right.
But don't forget that this is very Apache/mod_jk/Tomcat specific.
A more generic way of doing this would be to set an additional header in the request at 
the Apache level, and get this header at the Tomcat level with request.getHeader().
That would work with any proxying scheme between Apache and a back-end servlet engine 
(mod_jk, but also mod_proxy_http and mod_proxy_ajp).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic