jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <...@koberg.com>
Subject Re: add setUserPrincipal(Principal) to HttpServletRequestWrapper?
Date Mon, 31 Jan 2005 13:36:30 GMT
Vincent Massol wrote:
> Hi Robert,
> 
> I think this could be of interest to the larger group. If you have some
> time, I'd be happy to commit your patch (feel free to open a JIRA issue and
> attach a patch against the latest CVS).
> 
> You mentioned that you patched your local copy. Actually it's possible for
> you to have this feature without touching the Cactus codebase, which is
> better I think as it allows you to upgrade seamlessly.
> 
> The solution is to write a custom wrapper around HttpServletRequestWrapper.
> This custom wrapper would add the setUserPrincipal() method. In your test
> you would write:
> 
> public void testXXX()
> {
>     MyWrapper request2 = new MyWrapper(request);
> [...]
>     // use request2 instead of request in all calls requiring a request
> }


This sounds like the best way to go -- don't know why I did not do this...

thanks,
-Rob


> 
> Thanks
> -Vincent 

Mime
View raw message