hi ludovic, the string you wrote is the same as the string which would be created by deltaspike. (see the javadoc of NavigationParameterContext)
if you don't like NavigationParameterContext, you can inject ViewConfigResolver and use something like String outcomeWithParams = viewConfigResolver.getViewConfigDescriptor(Pages.MyPage.class).getViewId() + "?myParam=myValue..."; //... however, NavigationParameterContext is in place, because it allows to add parameters where it's needed (instead of collecting them and adding all of them once you trigger the navigation finally.) internally it's used to implement e.g. @NavigationParameter. regards, gerhard http://www.irian.at Your JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces, DeltaSpike and OpenWebBeans 2015-04-21 9:49 GMT+02:00 [email protected] <[email protected]>: > On 20/04/2015 19:16, Gerhard Petracek wrote: > >> hi ludovic, >> >> ViewParameterMode#INCLUDE just adds "includeViewParams=true" to the >> outcome. >> it is needed in your case, because you configured NavigationMode.REDIRECT. >> (-> the behavior is the same as with std. jsf - you just provide the >> information in a type-safe way instead of using strings. >> the jsf implementation you are using will see the same in both cases, >> because deltaspike just transforms your config to a std. navigation string >> and forwards that string to the wrapped-/default-implementation). >> > I understand that and it is a clear progress from "raw" NavigationHandler. > > However, one can also easily use : > > ConfigurableNavigationHandler configurableNavigationHandler = > (ConfigurableNavigationHandler) > FacesContext.getCurrentInstance().getApplication().getNavigationHandler(); > > configurableNavigationHandler.performNavigation("/my_page?faces-redirect=true&actid=whatever"); > > and add pass params only to the view we are navigating to. I do not > "semantically" want to add parameters to the current view. > > There are of course tons of other way to perform a redirect, like > > FacesContext.getCurrentInstance().getExternalContext().redirect("/my_page.xhtml?actid=<whatever>"); > > > I would like to keep the benefits of Type-save View-Configs while passing > parameters as easily as with the ConfigurableNavigationHandler. > > > Ludovic > | > | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT. > | > >
