You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Rainer Jung <ra...@kippdata.de> on 2007/02/19 18:31:05 UTC

Re: svn commit: r509173 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml xdocs/webserver_howto/apache.xml

Hi Mladen,

until 1.2.19 JkEnvVar  would throw apache configuration error, if only 
called with one argument. The behaviour of 1.2.20 and 1.2.21 is the same 
as before, if you use a second argument.

It was only in 1.2.20, that we introduced the possibility to omit the 
second argument, so give no default value.

In this case, if during runtime the variable gets set, again there is no 
change in behaviour.

The only change is, if you use a config that was syntactically wrong 
before 1.2.20 and your variable does not get set during runtime. Then 
1.2.20 would forward an empty string, and 1.2.21 will not forward the 
variable. I changed the documentation accordingly. Somehow the 
additional case in 1.2.20 was implemented with wrong behaviour by me in 
December.

Why is that change interesting?

tomcat has an attribute "condition" for the access log, that allows to 
not log a request, whenever the given request attribute is set. 
Unfortunately the implementation checks for the attribute being set, an 
empty string counts as set. It would be nice, if one could use 
mod_setenvif, to set the attribute e.g. for the probing requests from 
the external load balancers, systems management etc. and thus keep them 
seperate in the tomcat logs.

One is tempted to think, that one could remove the empty attribute in a 
tomcat servlet filter, but unfortunately a servlet filter can not delete 
attributes coming via mod_jk (which might be a bug in itself, but is 
much more difficult to fix).

By not sending the variable if it has no default and doesn't get set 
during runtime, JkEnvVar and "condition" are able to smoothly interoperate.

Regards,

Rainer


Mladen Turk wrote:
> rjung@apache.org wrote:
>>  
>>      /* env_name is mandatory, default_value is optional.
>> -     * No value means set the variable to an empty string.
>> +     * No value means send the attribute only, if the env var is set 
>> during runtime.
>>       */
> 
> Think this will break any existing configuration.
> Something like that cannot be part of the 1.2.x branch thought.
> 
>>  The directive <b>JkEnvVar</b> allows you to forward environment 
>> variables from Apache server to Tomcat engine.
>>  The variables can be retrieved on the Tomcat side as request attributes.
>>  You can add a default value as a second parameter to the directive.
>> -If the default value is not given explicitely, the empty string
>> -will be used as a default.
>> +If the default value is not given explicitely, the variable
>> +will only be send, if it is set during runtime.
> 
> What will be send in this cases:
> JkEnvVar FOO1
> JkEnvVar FOO2 BAR
> 
> 
> Regards,
> Mladen.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org