Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Setting/changing authorization header in Tomcat 5.*

Eugeny N Dzhurinsky

2007-01-16

Replies:

Hello!

Could somebody please advice what is a best way to implement a valve class,
which will just add custom authorization header if request matches some
conditions?

I looked at org.apache.catalina.Request interface and found there is a method

/**
* Set the authorization credentials sent with this request.
* @param authorization The new authorization credentials
*/
public void setAuthorization(String authorization);

declared, which is intented to do exactly what I need.

However in the org.apache.coyote.tomcat5.CoyoteRequest

  /**
  * Set the authorization credentials sent with this request.
  *
  * @param authorization The new authorization credentials
  */
  public void setAuthorization(String authorization) {
    // Not used
  }

but in the org.apache.coyote.tomcat4.CoyoteRequest this method is implemented
and seems to work?

Considering all described above, what do I need to do regarding the setting
custom authorization header? Use tomcat4 connectors rather than tomcat5 or I
miss something else?

--
Eugene N Dzhurinsky

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.