You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Garner Shawn <sh...@gmail.com> on 2006/10/04 20:07:21 UTC

[struts2] redirecting to a struts action in a filter

I have a filter and I'm trying to check a session value is set for security.
I'm putting my filter to the /admin/* url mapping.

My filter is getting hit but then if I try to do a redirect to a
struts action it seems like I get some kind of infinite filter loop
and is choking, I'm kind of new is there something that would do this?

Hmm, now I am thinking about it maybe I'm accidently including the
/admin/ in the redirect.  I'll check.

Also I was just using a plain request dispatcher to forward.
Is there a struts specific on I should be using?

Thanks,
Shawn

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [struts2] redirecting to a struts action in a filter

Posted by Chris Pratt <th...@gmail.com>.
Normally, with filters you chain when you're finished, not redirect.  The
only time you would redirect would be if the user wasn't logged in and you
wanted to redirect to your login page and then a plain ol' redirect should
work fine as long as you don't redirect to a page that's also under the
protection of your filter.
  (*Chris*)

On 10/4/06, Don Brown <do...@gmail.com> wrote:
>
> Sounds like you have the situation under control - you are probably
> forwarding to an /admin/ action.  As for the redirect, from a servlet
> filter, a plain redirect is the best approach.
>
> Don
>
> On 10/4/06, Garner Shawn <sh...@gmail.com> wrote:
> > I have a filter and I'm trying to check a session value is set for
> security.
> > I'm putting my filter to the /admin/* url mapping.
> >
> > My filter is getting hit but then if I try to do a redirect to a
> > struts action it seems like I get some kind of infinite filter loop
> > and is choking, I'm kind of new is there something that would do this?
> >
> > Hmm, now I am thinking about it maybe I'm accidently including the
> > /admin/ in the redirect.  I'll check.
> >
> > Also I was just using a plain request dispatcher to forward.
> > Is there a struts specific on I should be using?
> >
> > Thanks,
> > Shawn
> >
> > ---------------------------------------------------------------------
> > 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
>
>

Re: [struts2] redirecting to a struts action in a filter

Posted by Don Brown <do...@gmail.com>.
Sounds like you have the situation under control - you are probably
forwarding to an /admin/ action.  As for the redirect, from a servlet
filter, a plain redirect is the best approach.

Don

On 10/4/06, Garner Shawn <sh...@gmail.com> wrote:
> I have a filter and I'm trying to check a session value is set for security.
> I'm putting my filter to the /admin/* url mapping.
>
> My filter is getting hit but then if I try to do a redirect to a
> struts action it seems like I get some kind of infinite filter loop
> and is choking, I'm kind of new is there something that would do this?
>
> Hmm, now I am thinking about it maybe I'm accidently including the
> /admin/ in the redirect.  I'll check.
>
> Also I was just using a plain request dispatcher to forward.
> Is there a struts specific on I should be using?
>
> Thanks,
> Shawn
>
> ---------------------------------------------------------------------
> 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