Generating JSF url without windowid parameter
In my JSF web application, I want to create a bookmark or copy url. This part is pretty simple, for example:
<h:link value="Permanent Link"
outcome="/showStuff">
<f:param name="recID" value="#{bean.recordID}" />
</h:link>
Although this link has the desired parameter (recID) in it, it also has a windowid parameter generated by the JSF servlet. Is there a convenient way to generate a url without the windowid parameter ? Or does it matter?
(This is with Mojarra)
+3
source to share
1 answer
You can remove WindowId using URLRewriteFilter framework like OCPsoft Rewrite URLRewriteFilter
Doing something like this should be easy enough using a single configuration rule. Obviously, you can play if this rule is too strict or too general.
.defineRule()
.when(Direction.isOutbound().and(
URL.matches("{prefix}{windowId}{suffix}")
.where("windowId").matches("windowId=[^&]+")))
.perform(Substitute.with("{prefix}{suffix}"))
Check the rewrite site. It's pretty easy to set up. http://ocpsoft.org/rewrite/
+5
source to share