Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mojarra-dev] [faces-dev] faces-redirect=true alternative via Annotation?

Yes, redirecting to the same current view with faces-redirect=true. (just as void methods return you to the same view)

On second thought, it might not be the everyday use case, since in most cases you  really don't need to fire a redirect when you are returning the same page.

Thanks.

On Wed, Feb 17, 2021 at 1:57 PM Thomas Andraschko <tandraschko@xxxxxxxxxx> wrote:
I dont understand your question. Why would you redirect to the same view as the current view?

Am Mi., 17. Feb. 2021 um 14:44 Uhr schrieb Edwin Amoakwa <edwin.amoakwa@xxxxxxxxx>:
Hello Thomas,

My Knowledge of the JSF internals is very limited so permit me to ask this. Can't the FacesContext.getCurrentInstance().getViewRoot().getViewId() be called to determine the URL for the void method?



On Wed, Feb 17, 2021 at 1:22 PM Thomas Andraschko <tandraschko@xxxxxxxxxx> wrote:
This would only possible if @Redirect would also take a value.

@Redirect + non-void-return-value would work

or

@Redirect("myView.xhtml") + void method would work

Am Mi., 17. Feb. 2021 um 14:14 Uhr schrieb Edwin Amoakwa <edwin.amoakwa@xxxxxxxxx>:
Great !!!

Will it be applicable to void methods e.g

@Redirect
public void action()
{
    doSomeOtherAction();
}


On Wed, Feb 17, 2021 at 10:35 AM Thomas Andraschko <tandraschko@xxxxxxxxxx> wrote:
I could prototype it in MyFaces.

Best regards,
Thomas
_______________________________________________
mojarra-dev mailing list
mojarra-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mojarra-dev
_______________________________________________
mojarra-dev mailing list
mojarra-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mojarra-dev
_______________________________________________
mojarra-dev mailing list
mojarra-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mojarra-dev
_______________________________________________
mojarra-dev mailing list
mojarra-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mojarra-dev
_______________________________________________
faces-dev mailing list
faces-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/faces-dev

Back to the top