Servlet filter woes

Hi all. I’ve got an interesting one. I’m testing out a servlet
filter that will handle SSO for a rails app. The filter is triggered
dynamically when a certain http status is emitted from the rails app.
Once the filter is triggered, it needs to alter the response status
and headers of the original rails http response. However, it appears
that the rails servlet (goldspike) closes the output stream which
prevents a servlet filter from altering the response. If I test it
the filter with a non rails based app (jsp, servlet), it works as
expected.

I haven’t tested this with Nick’s rack servlet yet, but I assume I’ll
get the same results.

Any suggestions?

Rich

As a last resort, you could wrap the original HttpServletResponse that
goes
to Goldspike, inside your filter.
Then, ignore the flush() and close() calls in the wrapped
HttpServletResponse.

On Thu, May 22, 2008 at 6:11 AM, Rich M. [email protected]
wrote:

I haven’t tested this with Nick’s rack servlet yet, but I assume I’ll
get the same results.

Any suggestions?

Rich


ƃuɐlɐuɐɯ ɥɔıɹ


Fabio K.

Caelum - Ensino e Soluções em Computação

On Thu, May 22, 2008 at 4:11 AM, Rich M. [email protected]
wrote:

I haven’t tested this with Nick’s rack servlet yet, but I assume I’ll
get the same results.

Any suggestions?

I am not calling close on the servlet response in jruby-rack.
(Although I know you have another issue Rich that we need to sort
out.) Fabio’s suggestion is a good workaround, however.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks… was just about to do what Fabio suggested. I can probably
go with rack now. This next project doesn’t have a hard requirement
to use Oracle AppServer.

Rich