Re: Rewrite spaces in URL

Splash Forums PrettyFaces Users Rewrite spaces in URL Re: Rewrite spaces in URL

#21457

m1m
Participant

Could you post simple example how to use conventers for path parameters?

This is not working for me:

@URLMapping(id = "page",
viewId = "/page.html",
pattern = "/#{name}-#{id}/",
converter=@URLConverter(index=0,converterId="testConv"))
....
@FacesConverter("testConv")
public class TestConv implements Converter {

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
return value.toUpperCase();
}

@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
return value.toString().toUpperCase();
}
}

#{name} is not mapped to backing bean, it is only set by f:param inside h:link for seo purposes only

Should this converter be executed before creating link in html source?