Passing query string with PrettyFaces -
i'm working jsf2 , prettyfaces creating 'seo-friendly urls'.
i'm facing problem when want pass parameters after prettyfaces creating new url parameters been delete , want avoid that.
i explain example:
when hitting url:
http://www.mysite.com/index.jsf?param1=value1¶m2=value2
after prettyfaces i'm getting url:
http://www.mysite.com/
but want that, when hitting url:
http://www.mysite.com/index.jsf?param1=value1¶m2=value2
after prettyfaces i'll url:
http://www.mysite.com/?param1=value1
please note: want pass specific parameters. example above, param1
should passed.
my configuration on 'pretty-config.xml':
<url-mapping> <pattern>/</pattern> <view-id>/jsp/index.jsf</view-id> </url-mapping>
i'm surprised query string not being preserved. guess else going on, other prettyfaces. version of prettyfaces using? i'm guessing is problem prettyfaces, bug in version you're using, think that's unlikely.
the only thing url-mapping
you've pasted should perform internal forward "/" "/jsp/index.jsf". not client redirection "/index.jsf" "/"; why think there else @ play here. (see code reference: https://github.com/ocpsoft/rewrite/blob/master/config-prettyfaces/src/main/java/org/ocpsoft/rewrite/prettyfaces/urlmappingruleadaptor.java#l213)
with regard stripping out query parameters , leaving others, highly suggest looking @ rewrite framework (which new core of prettyfaces), can use build custom rewriting rules: http://ocpsoft.org/prettyfaces/ , http://ocpsoft.org/rewrite/
i hope helps.
Comments
Post a Comment