Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl
Re: set environment variables in tomcat
 

Index | Next | Previous | View Flat


aw at ice-sa

Jun 2, 2011, 3:47 AM


Views: 1244
Permalink
Re: set environment variables in tomcat [In reply to]

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).

Subject User Time
set environment variables in tomcat kgoldov at gmail May 26, 2011, 5:24 PM
    Re: set environment variables in tomcat fred at redhotpenguin May 26, 2011, 7:11 PM
    Re: set environment variables in tomcat aw at ice-sa May 26, 2011, 11:48 PM
    RE: set environment variables in tomcat James.B.Muir at hitchcock May 27, 2011, 5:59 AM
    Re: set environment variables in tomcat aw at ice-sa May 27, 2011, 7:36 AM
        Re: set environment variables in tomcat kgoldov at gmail Jun 1, 2011, 3:31 PM
            Re: set environment variables in tomcat aw at ice-sa Jun 2, 2011, 3:47 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.