struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <thechrispr...@gmail.com>
Subject Re: login interceptor and a servlet
Date Mon, 04 May 2009 04:20:47 GMT
Sure, you can either implement ServletResponseAware and write directly to
the stream, then return null from execute() to tell struts that there is no
additional result required.  Or, even better, you can use the Stream result
type and let Struts write it to the stream for you.
  (*Chris*)

On Sun, May 3, 2009 at 8:45 PM, Kate Fox <kfox@anchorintelligence.com>wrote:

> Hi Chris,
>
> Thanks for the quick response.  Unfortunately my servlet is a true servlet.
>  I need to write directly to the OutputStream.  Is there a way to do that
> with an image action?
>
> Thanks,
>
> Kate
>
>
> Chris Pratt wrote:
>
>> If your image servlet is a true servlet acting outside of struts, it won't
>> be subject to the interceptor stack.  If it's actually an image action,
>> just
>> assign it a different interceptor stack that doesn't contain your
>> LoginInterceptor and you'll be good to go.
>>  (*Chris*)
>>
>> On Sun, May 3, 2009 at 8:28 PM, Kate Fox <kfox@anchorintelligence.com
>> >wrote:
>>
>>
>>
>>> I have a login interceptor to check login on all my pages.  I also have a
>>> servlet that serves up images.  The servlet does not go through the login
>>> interceptor.  Is there a way to force it that way?
>>>
>>> Here is my login interceptor definition:
>>>
>>>      <interceptors>
>>>          <interceptor name="login" class="LoginInterceptor" />
>>>          <interceptor-stack name="defaultLoginStack">
>>>              <interceptor-ref name="servlet-config" />
>>>              <interceptor-ref name="params" />
>>>              <interceptor-ref name="login" />
>>>              <interceptor-ref name="prepare" />
>>>              <interceptor-ref name="i18n"/>
>>>              <interceptor-ref name="chain" />
>>>          </interceptor-stack>
>>>      </interceptors>
>>>
>>> Thanks for your help,
>>>
>>> Kate
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message