Re: Cannot get URL param on facebook redirect

Splash Forums PrettyFaces Users Cannot get URL param on facebook redirect Re: Cannot get URL param on facebook redirect

#21157

Sorry for my late reply. I was very busy the last days.

Did you find a solution for your problem?

If not I suggest you to take a look at the custom rewrite processor to implement something like this. My understanding is that you want to create a shorter version of the ugly long code and use this for the callback that Facebook redirects the users to?

You could try something like this (untested):

<rewrite match="/shortcode/(w+)" processor="com.example.myapp.MyCustomProcessor" redirect="chain" />

And the custom rewrite processor:

public class MyCustomProcessor implements Processor {

@Override
public String processInbound(HttpServletRequest request, HttpServletResponse response, RewriteRule rule, String url) {

// get the short code by parsing the URL
String shortCode = getShortCodeFromUrl(url);

// get the long version of the code
String code = URLGenerator.getInstance().getCodeFromShortCode(shortCode);

// forward to the new URL
return "/faces/Index.xhtml?code="+code;

}

@Override
public String processOutbound(HttpServletRequest request, HttpServletResponse response, RewriteRule rule, String url) {
// do nothing
return url;
}

}