Search in sources :

Example 1 with NavigationParameterContext

use of org.apache.deltaspike.core.api.config.view.navigation.NavigationParameterContext in project deltaspike by apache.

the class JsfUtils method getViewConfigPageParameters.

public static Set<RequestParameter> getViewConfigPageParameters() {
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
    Set<RequestParameter> result = new HashSet<RequestParameter>();
    if (//detection of early config for different mojarra versions
    externalContext == null || externalContext.getRequestParameterValuesMap() == null || externalContext.getRequest() == null) {
        return result;
    }
    NavigationParameterContext navigationParameterContext = BeanProvider.getContextualReference(NavigationParameterContext.class);
    for (Map.Entry<String, String> entry : navigationParameterContext.getPageParameters().entrySet()) {
        //TODO add multi-value support
        result.add(new RequestParameter(entry.getKey(), new String[] { entry.getValue() }));
    }
    return result;
}
Also used : NavigationParameterContext(org.apache.deltaspike.core.api.config.view.navigation.NavigationParameterContext) ExternalContext(javax.faces.context.ExternalContext) Map(java.util.Map) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Map (java.util.Map)1 ExternalContext (javax.faces.context.ExternalContext)1 NavigationParameterContext (org.apache.deltaspike.core.api.config.view.navigation.NavigationParameterContext)1