Currently I´m trying the following JSF - Lib:
https://www.ocpsoft.org/rewrite/examples/
I have the following issue:
I have a page: /page.jsf
In my page I have more then only one parameter. E.g. I have: - parameter1 - parameter2
String parameter1 = FacesContext.getCurrentInstance().getExternalContext()
.getRequestParameterMap().get("parameter1");
String parameter2 = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()
.get("parameter2");
Currently I understood I can add this in my UrlConfigProvider class:
.addRule(Join.path("/page/{parameter1}").to("/portal/mypage.jsf") .withInboundCorrection())
This is working for one parameter.
But how can I do this for multiple parameter, so the URL is then: /page/{parameter1}/{parameter2} ....
Any ideas?
The rewrite API doesn't bring a native solution for this problem.
Kick-Off Example
Explanation
The only important piece is the
HttpOperation. By default theServletRequestis wrapped in aHttpRewriteWrappedRequest.The default
HttpServletRequestdoesn't allow to change the parameters once they were initialized. The methodgetParameterMap()returns an immutable map.getParameterMap()of theHttpRewriteWrappedRequestalso returns an immutable map. ButgetModifiableMap()returns obviously a modifiable map.The rest should be self-explanatory.
See Also
Ocpsoft: How to modify parameters
Modify request parameter with servlet filter