Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JSF and the fly likes multi-client web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "multi-client web application" Watch "multi-client web application" New topic

multi-client web application

Janez Novak
Ranch Hand

Joined: Feb 09, 2009
Posts: 31
Hi All,

JSF based web application has more than one presentation that is one for desktop browsers and one for mobile devices. Searching web and this forum i found two approaches how to accomplish this:
- Use a framework which will handle mobile UI components (MyFaces Trinidad, PrimeFaces)
- Create new or use existing Rendering kit for mobile devices

Because web application will use ajax my current choice is to use for example PrimeFaces for mobile web application. Intention here is to reuse as much as possible.
I understand that since web application uses ajax those component will not be able to render automatically to mobile web application. Plan is to reuse model and controller in JSF and create new view for mobile devices.

Please suggest if this is good approach or any other best practices regarding mobile web application using JSF.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

AJAX only indirectly has to do with rendering. AJAX is mostly about data transfer. However, some mobile devices have only limited JavaScript functionality, so AJAX isn't 100% guaranteed to work.

The ideal approach is definitely to use client-friendly renderkits. The problem, as you've discovered, is that a lot of JSF controlsets only include a desktop HTML renderkit. If you need to support code on mobile devices, ideally you'd have a renderkit that could fall back to non-AJAX solutions when AJAX wasn't availablee.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: multi-client web application
It's not a secret anymore!