Splash › Forums › PrettyFaces Users › how to map an url like www.example.com?foo=bar
Tagged: google, oAuth2, plain old urls
This topic contains 2 replies, has 2 voices, and was last updated by Christian Kaltepoth 9 years, 5 months ago.
How do I write a mapping for an url like ?foo=bar
It is a callback redirect url from google oAuth2, which looks like a plain old url…
I have to specify the redirect url, and google appends it with some key=value params in the plain old url style…
I tried the patterns:
But these pattners doesn’t match the resulting url.
Nevermind, I fixed it.
In case someone else wonders how:
I created pretty-config.xml with the following contents:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rewrite match="/oauth2callback?state=(w+)&code=(w+)" url="http://localhost:8080/mysite/oauth2callback/$1/$2"/>
you could also declare the query parameters in your mapping like this:
<pattern value="/oauth2callback" />
<view-id value="/faces/something.jsf" />
The forum ‘PrettyFaces Users’ is closed to new topics and replies.
Comments are closed.
If you find our tools useful, please consider making a donation to help us stay online and building software!