Yeah, my bad... I cracked open the authorization filter I wrote because I
didn't want to give a wrong answer off the top of my head... problem is,
that filter just redirects to a "Go away, your not allowed in here!" kind
of page, so there was no concern with losing request parameters in that
use case.  Good call Joe :)  Whether he needs the contents of request of
not it's a good point to be aware of.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, March 29, 2005 1:24 pm, Joe Germuska said:
> Frank's suggestion might work, although note that it would result in
> the discarding of all request parameters, which may not be what you
> want.
>
> If you have complex session initialization logic in an Action and you
> want to use it in the Filter, I'd suggest factoring it out into a
> utility class.  Alternatively, don't try to use the filter to do
> this: the main reason to use a filter is to apply common logic upon
> every request (or at least many requests); if you have all this in an
> Action now, that suggests you only use it once.
>
> You could probably also somehow use the Filter to set a request
> attribute, and then subclass the RequestProcessor to recognize that
> request attribute as an instruction to invoke your session-prep
> action -- but that seems way more complicated than you really need.
>
> Joe
>
>
> At 12:45 PM -0500 3/29/05, Frank W. Zammetti wrote:
>>response.sendRedirect(url);
>>
>>That's what I do.  You do get a reference to request, so I would assume
>>you could get a dispatcher off it and do what you always do.  I've never
>>had a need to try it though.
>>
>>--
>>Frank W. Zammetti
>>Founder and Chief Software Architect
>>Omnytex Technologies
>>http://www.omnytex.com
>>
>>On Tue, March 29, 2005 12:40 pm, Denis Avdic said:
>>>  Hello all,
>>>
>>>  Although I've been using Struts for small projects for a while now, I
>>>  haven't really used filters.  Now I am incorporating some
>>>  functionality from another project into mine, and the other project
>>>  used plain old servlets and filters.
>>>
>>>  My question is this:
>>>
>>>  In filter's doFilter method, is there a way to forward to a Struts
>>>  action somehow?  I need to populate the session and I have all this
>>>  stuff already written, I just need to do a forward to the action
>>>  somehow.  How could I do this without request.getRequestDispatcher()
>>>  calls?  Or can I do it at all?
>>>
>>>
>>>  I haven't wrote pure servlet in a looooong long while and I forgot a
>>>  lot of things so please excuse me if my question is dumb.
>>>
>>>
>>>  Thanks,
>>>
>>>  Denis
>>>
>>>  ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> --
> Joe Germuska
> [EMAIL PROTECTED]
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to