Primefaces - How to redirect to the mobile version?

I created the site in JSF 2 (primefaces 3.3), and now I want to create a mobile version. I have different views on the desktop / mobile. I am already creating a custom handler for detecting mobile browsers. It works great. But I don’t understand how to redirect the user to mobile pages. I searched a lot, and no one says where this step is. At what stage should I do this? Redirect user and how?

+5
source share
2 answers

Performing a browser discovery job in Filterappears on FacesServletinstead ViewHandler.

Then it's just like

if (needsRedirectToMobileURL) {
    response.sendRedirect(mobileURL);
}
else {
    chain.doFilter(request, response);
}

A ViewHandler /. JSF .

+8

All Articles