You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Thomas Andraschko <zo...@googlemail.com> on 2012/06/19 10:46:48 UTC

[CODI] redirect to ErrorView instead of Forward

Hi,

is it possible to send a redirect instead of forward for the ErrorView?
We cache some of our pages and sometimes the ErrorView will be cached
instead of the real view.

Regards,
Thomas

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Thomas Andraschko <zo...@googlemail.com>.
Hi Gehard,

created! https://issues.apache.org/jira/browse/EXTCDI-296

Thanks!

Regards,
Thomas

2012/6/19 Gerhard Petracek <ge...@gmail.com>

> hi thomas,
>
> yes - that's what i had in mind.
> please create a jira ticket (improvement).
>
> thx & regards,
> gerhard
>
> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> > Hi,
> >
> > i tested it and it works fine :)
> > Is it possible to add an config option to CODI to allow navigation in all
> > cases?
> >
> > Regards,
> > Thomas
> >
> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
> >
> >> hi thomas,
> >>
> >> it used to cause issues with some
> >> constellations/use-cases/component-libs/... .
> >>
> >> before we do something about it:
> >> it would be nice if you just remove the check of 'allowNavigation' in
> >> SecurityUtils#processApplicationSecurityException and test it with
> >> your application.
> >>
> >> regards,
> >> gerhard
> >>
> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> >> > Hi Gerhard,
> >> >
> >> > why isn't possible to redirect?
> >> > I though it should be possible every time :)
> >> >
> >> > Currently i just throw my own RuntimeException in the
> >> > AccessDecisionVoter
> >> > and do an redirect in my ExceptionHandler.
> >> > This works fine but it's only a workaround.
> >> >
> >> > Regards,
> >> > Thomas
> >> >
> >> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
> >> >
> >> >> hi thomas,
> >> >>
> >> >> the ViewConfigAwareNavigationHandler will do the redirect (if
> needed).
> >> >> however, a navigation isn't possible at any point in the lifecycle ->
> >> >> depending on the value of 'allowNavigation' in
> >> >> SecurityUtils#processApplicationSecurityException you can use it.
> >> >>
> >> >> regards,
> >> >> gerhard
> >> >>
> >> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> >> >> > Hi Gerhard,
> >> >> >
> >> >> > yes i know but i mean:
> >> >> >
> >> >> > @Secured(value = LoginAccessDecisionVoter.class, errorView =
> >> >> > SessionExpired.class)
> >> >> >
> >> >> > I can't define if redirect or forward should be used for this error
> >> >> > view.
> >> >> > Right?
> >> >> > AFAICS CODI always use the NavigationHandler in
> >> >> > Security.processApplicationSecurityException which does a forward.
> >> >> >
> >> >> > Thanks,
> >> >> > Thomas
> >> >> >
> >> >> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
> >> >> >
> >> >> >> hi thomas,
> >> >> >>
> >> >> >> you can use:
> >> >> >> @Page(navigation = Page.NavigationMode.REDIRECT) for any
> >> >> >> view-config.
> >> >> >>
> >> >> >> regards,
> >> >> >> gerhard
> >> >> >>
> >> >> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> >> >> >> > Hi,
> >> >> >> >
> >> >> >> > is it possible to send a redirect instead of forward for the
> >> >> ErrorView?
> >> >> >> > We cache some of our pages and sometimes the ErrorView will be
> >> >> >> > cached
> >> >> >> > instead of the real view.
> >> >> >> >
> >> >> >> > Regards,
> >> >> >> > Thomas
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >>
> >> >> >> http://www.irian.at
> >> >> >>
> >> >> >> Your JSF/JavaEE powerhouse -
> >> >> >> JavaEE Consulting, Development and
> >> >> >> Courses in English and German
> >> >> >>
> >> >> >> Professional Support for Apache MyFaces
> >> >> >>
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> http://www.irian.at
> >> >>
> >> >> Your JSF/JavaEE powerhouse -
> >> >> JavaEE Consulting, Development and
> >> >> Courses in English and German
> >> >>
> >> >> Professional Support for Apache MyFaces
> >> >>
> >> >
> >>
> >>
> >> --
> >>
> >> http://www.irian.at
> >>
> >> Your JSF/JavaEE powerhouse -
> >> JavaEE Consulting, Development and
> >> Courses in English and German
> >>
> >> Professional Support for Apache MyFaces
> >>
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Gerhard Petracek <ge...@gmail.com>.
hi thomas,

yes - that's what i had in mind.
please create a jira ticket (improvement).

thx & regards,
gerhard

2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> Hi,
>
> i tested it and it works fine :)
> Is it possible to add an config option to CODI to allow navigation in all
> cases?
>
> Regards,
> Thomas
>
> 2012/6/19 Gerhard Petracek <ge...@gmail.com>
>
>> hi thomas,
>>
>> it used to cause issues with some
>> constellations/use-cases/component-libs/... .
>>
>> before we do something about it:
>> it would be nice if you just remove the check of 'allowNavigation' in
>> SecurityUtils#processApplicationSecurityException and test it with
>> your application.
>>
>> regards,
>> gerhard
>>
>> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
>> > Hi Gerhard,
>> >
>> > why isn't possible to redirect?
>> > I though it should be possible every time :)
>> >
>> > Currently i just throw my own RuntimeException in the
>> > AccessDecisionVoter
>> > and do an redirect in my ExceptionHandler.
>> > This works fine but it's only a workaround.
>> >
>> > Regards,
>> > Thomas
>> >
>> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
>> >
>> >> hi thomas,
>> >>
>> >> the ViewConfigAwareNavigationHandler will do the redirect (if needed).
>> >> however, a navigation isn't possible at any point in the lifecycle ->
>> >> depending on the value of 'allowNavigation' in
>> >> SecurityUtils#processApplicationSecurityException you can use it.
>> >>
>> >> regards,
>> >> gerhard
>> >>
>> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
>> >> > Hi Gerhard,
>> >> >
>> >> > yes i know but i mean:
>> >> >
>> >> > @Secured(value = LoginAccessDecisionVoter.class, errorView =
>> >> > SessionExpired.class)
>> >> >
>> >> > I can't define if redirect or forward should be used for this error
>> >> > view.
>> >> > Right?
>> >> > AFAICS CODI always use the NavigationHandler in
>> >> > Security.processApplicationSecurityException which does a forward.
>> >> >
>> >> > Thanks,
>> >> > Thomas
>> >> >
>> >> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
>> >> >
>> >> >> hi thomas,
>> >> >>
>> >> >> you can use:
>> >> >> @Page(navigation = Page.NavigationMode.REDIRECT) for any
>> >> >> view-config.
>> >> >>
>> >> >> regards,
>> >> >> gerhard
>> >> >>
>> >> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
>> >> >> > Hi,
>> >> >> >
>> >> >> > is it possible to send a redirect instead of forward for the
>> >> ErrorView?
>> >> >> > We cache some of our pages and sometimes the ErrorView will be
>> >> >> > cached
>> >> >> > instead of the real view.
>> >> >> >
>> >> >> > Regards,
>> >> >> > Thomas
>> >> >> >
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> http://www.irian.at
>> >> >>
>> >> >> Your JSF/JavaEE powerhouse -
>> >> >> JavaEE Consulting, Development and
>> >> >> Courses in English and German
>> >> >>
>> >> >> Professional Support for Apache MyFaces
>> >> >>
>> >> >
>> >>
>> >>
>> >> --
>> >>
>> >> http://www.irian.at
>> >>
>> >> Your JSF/JavaEE powerhouse -
>> >> JavaEE Consulting, Development and
>> >> Courses in English and German
>> >>
>> >> Professional Support for Apache MyFaces
>> >>
>> >
>>
>>
>> --
>>
>> http://www.irian.at
>>
>> Your JSF/JavaEE powerhouse -
>> JavaEE Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>


-- 

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Thomas Andraschko <zo...@googlemail.com>.
Hi,

i tested it and it works fine :)
Is it possible to add an config option to CODI to allow navigation in all
cases?

Regards,
Thomas

2012/6/19 Gerhard Petracek <ge...@gmail.com>

> hi thomas,
>
> it used to cause issues with some
> constellations/use-cases/component-libs/... .
>
> before we do something about it:
> it would be nice if you just remove the check of 'allowNavigation' in
> SecurityUtils#processApplicationSecurityException and test it with
> your application.
>
> regards,
> gerhard
>
> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> > Hi Gerhard,
> >
> > why isn't possible to redirect?
> > I though it should be possible every time :)
> >
> > Currently i just throw my own RuntimeException in the AccessDecisionVoter
> > and do an redirect in my ExceptionHandler.
> > This works fine but it's only a workaround.
> >
> > Regards,
> > Thomas
> >
> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
> >
> >> hi thomas,
> >>
> >> the ViewConfigAwareNavigationHandler will do the redirect (if needed).
> >> however, a navigation isn't possible at any point in the lifecycle ->
> >> depending on the value of 'allowNavigation' in
> >> SecurityUtils#processApplicationSecurityException you can use it.
> >>
> >> regards,
> >> gerhard
> >>
> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> >> > Hi Gerhard,
> >> >
> >> > yes i know but i mean:
> >> >
> >> > @Secured(value = LoginAccessDecisionVoter.class, errorView =
> >> > SessionExpired.class)
> >> >
> >> > I can't define if redirect or forward should be used for this error
> >> > view.
> >> > Right?
> >> > AFAICS CODI always use the NavigationHandler in
> >> > Security.processApplicationSecurityException which does a forward.
> >> >
> >> > Thanks,
> >> > Thomas
> >> >
> >> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
> >> >
> >> >> hi thomas,
> >> >>
> >> >> you can use:
> >> >> @Page(navigation = Page.NavigationMode.REDIRECT) for any view-config.
> >> >>
> >> >> regards,
> >> >> gerhard
> >> >>
> >> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> >> >> > Hi,
> >> >> >
> >> >> > is it possible to send a redirect instead of forward for the
> >> ErrorView?
> >> >> > We cache some of our pages and sometimes the ErrorView will be
> >> >> > cached
> >> >> > instead of the real view.
> >> >> >
> >> >> > Regards,
> >> >> > Thomas
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> http://www.irian.at
> >> >>
> >> >> Your JSF/JavaEE powerhouse -
> >> >> JavaEE Consulting, Development and
> >> >> Courses in English and German
> >> >>
> >> >> Professional Support for Apache MyFaces
> >> >>
> >> >
> >>
> >>
> >> --
> >>
> >> http://www.irian.at
> >>
> >> Your JSF/JavaEE powerhouse -
> >> JavaEE Consulting, Development and
> >> Courses in English and German
> >>
> >> Professional Support for Apache MyFaces
> >>
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Gerhard Petracek <ge...@gmail.com>.
hi thomas,

it used to cause issues with some constellations/use-cases/component-libs/... .

before we do something about it:
it would be nice if you just remove the check of 'allowNavigation' in
SecurityUtils#processApplicationSecurityException and test it with
your application.

regards,
gerhard

2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> Hi Gerhard,
>
> why isn't possible to redirect?
> I though it should be possible every time :)
>
> Currently i just throw my own RuntimeException in the AccessDecisionVoter
> and do an redirect in my ExceptionHandler.
> This works fine but it's only a workaround.
>
> Regards,
> Thomas
>
> 2012/6/19 Gerhard Petracek <ge...@gmail.com>
>
>> hi thomas,
>>
>> the ViewConfigAwareNavigationHandler will do the redirect (if needed).
>> however, a navigation isn't possible at any point in the lifecycle ->
>> depending on the value of 'allowNavigation' in
>> SecurityUtils#processApplicationSecurityException you can use it.
>>
>> regards,
>> gerhard
>>
>> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
>> > Hi Gerhard,
>> >
>> > yes i know but i mean:
>> >
>> > @Secured(value = LoginAccessDecisionVoter.class, errorView =
>> > SessionExpired.class)
>> >
>> > I can't define if redirect or forward should be used for this error
>> > view.
>> > Right?
>> > AFAICS CODI always use the NavigationHandler in
>> > Security.processApplicationSecurityException which does a forward.
>> >
>> > Thanks,
>> > Thomas
>> >
>> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
>> >
>> >> hi thomas,
>> >>
>> >> you can use:
>> >> @Page(navigation = Page.NavigationMode.REDIRECT) for any view-config.
>> >>
>> >> regards,
>> >> gerhard
>> >>
>> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
>> >> > Hi,
>> >> >
>> >> > is it possible to send a redirect instead of forward for the
>> ErrorView?
>> >> > We cache some of our pages and sometimes the ErrorView will be
>> >> > cached
>> >> > instead of the real view.
>> >> >
>> >> > Regards,
>> >> > Thomas
>> >> >
>> >>
>> >>
>> >> --
>> >>
>> >> http://www.irian.at
>> >>
>> >> Your JSF/JavaEE powerhouse -
>> >> JavaEE Consulting, Development and
>> >> Courses in English and German
>> >>
>> >> Professional Support for Apache MyFaces
>> >>
>> >
>>
>>
>> --
>>
>> http://www.irian.at
>>
>> Your JSF/JavaEE powerhouse -
>> JavaEE Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>


-- 

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Thomas Andraschko <zo...@googlemail.com>.
Hi Gerhard,

why isn't possible to redirect?
I though it should be possible every time :)

Currently i just throw my own RuntimeException in the AccessDecisionVoter
and do an redirect in my ExceptionHandler.
This works fine but it's only a workaround.

Regards,
Thomas

2012/6/19 Gerhard Petracek <ge...@gmail.com>

> hi thomas,
>
> the ViewConfigAwareNavigationHandler will do the redirect (if needed).
> however, a navigation isn't possible at any point in the lifecycle ->
> depending on the value of 'allowNavigation' in
> SecurityUtils#processApplicationSecurityException you can use it.
>
> regards,
> gerhard
>
> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> > Hi Gerhard,
> >
> > yes i know but i mean:
> >
> > @Secured(value = LoginAccessDecisionVoter.class, errorView =
> > SessionExpired.class)
> >
> > I can't define if redirect or forward should be used for this error view.
> > Right?
> > AFAICS CODI always use the NavigationHandler in
> > Security.processApplicationSecurityException which does a forward.
> >
> > Thanks,
> > Thomas
> >
> > 2012/6/19 Gerhard Petracek <ge...@gmail.com>
> >
> >> hi thomas,
> >>
> >> you can use:
> >> @Page(navigation = Page.NavigationMode.REDIRECT) for any view-config.
> >>
> >> regards,
> >> gerhard
> >>
> >> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> >> > Hi,
> >> >
> >> > is it possible to send a redirect instead of forward for the
> ErrorView?
> >> > We cache some of our pages and sometimes the ErrorView will be cached
> >> > instead of the real view.
> >> >
> >> > Regards,
> >> > Thomas
> >> >
> >>
> >>
> >> --
> >>
> >> http://www.irian.at
> >>
> >> Your JSF/JavaEE powerhouse -
> >> JavaEE Consulting, Development and
> >> Courses in English and German
> >>
> >> Professional Support for Apache MyFaces
> >>
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Gerhard Petracek <ge...@gmail.com>.
hi thomas,

the ViewConfigAwareNavigationHandler will do the redirect (if needed).
however, a navigation isn't possible at any point in the lifecycle ->
depending on the value of 'allowNavigation' in
SecurityUtils#processApplicationSecurityException you can use it.

regards,
gerhard

2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> Hi Gerhard,
>
> yes i know but i mean:
>
> @Secured(value = LoginAccessDecisionVoter.class, errorView =
> SessionExpired.class)
>
> I can't define if redirect or forward should be used for this error view.
> Right?
> AFAICS CODI always use the NavigationHandler in
> Security.processApplicationSecurityException which does a forward.
>
> Thanks,
> Thomas
>
> 2012/6/19 Gerhard Petracek <ge...@gmail.com>
>
>> hi thomas,
>>
>> you can use:
>> @Page(navigation = Page.NavigationMode.REDIRECT) for any view-config.
>>
>> regards,
>> gerhard
>>
>> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
>> > Hi,
>> >
>> > is it possible to send a redirect instead of forward for the ErrorView?
>> > We cache some of our pages and sometimes the ErrorView will be cached
>> > instead of the real view.
>> >
>> > Regards,
>> > Thomas
>> >
>>
>>
>> --
>>
>> http://www.irian.at
>>
>> Your JSF/JavaEE powerhouse -
>> JavaEE Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>


-- 

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Thomas Andraschko <zo...@googlemail.com>.
Hi Gerhard,

yes i know but i mean:

@Secured(value = LoginAccessDecisionVoter.class, errorView =
SessionExpired.class)

I can't define if redirect or forward should be used for this error view.
Right?
AFAICS CODI always use the NavigationHandler in
Security.processApplicationSecurityException which does a forward.

Thanks,
Thomas

2012/6/19 Gerhard Petracek <ge...@gmail.com>

> hi thomas,
>
> you can use:
> @Page(navigation = Page.NavigationMode.REDIRECT) for any view-config.
>
> regards,
> gerhard
>
> 2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> > Hi,
> >
> > is it possible to send a redirect instead of forward for the ErrorView?
> > We cache some of our pages and sometimes the ErrorView will be cached
> > instead of the real view.
> >
> > Regards,
> > Thomas
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: [CODI] redirect to ErrorView instead of Forward

Posted by Gerhard Petracek <ge...@gmail.com>.
hi thomas,

you can use:
@Page(navigation = Page.NavigationMode.REDIRECT) for any view-config.

regards,
gerhard

2012/6/19, Thomas Andraschko <zo...@googlemail.com>:
> Hi,
>
> is it possible to send a redirect instead of forward for the ErrorView?
> We cache some of our pages and sometimes the ErrorView will be cached
> instead of the real view.
>
> Regards,
> Thomas
>


-- 

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces