This [1] is some code from one of my pages doing what you ask for. You
could also wrap this in a dispatcher, use rewrite rules on your http
server or tuckey.org java rewrite filter.

Good luck,
Joost


[1]: forward iphone users to another page
@Inject
    private RequestGlobals requestGlobals;

    @OnEvent(value = EventConstants.ACTIVATE)
    private Object activate() {

        HttpServletRequest httpServletRequest =
requestGlobals.getHTTPServletRequest();
        String userAgent = httpServletRequest.getHeader("User-Agent");
        if(userAgent.contains("iPhone")) {
            //return a page, link URL etc. to forward wherever you
want them to go
        }

        return null;
    }

On Fri, Aug 20, 2010 at 8:19 AM, Kalle Korhonen
<kalle.o.korho...@gmail.com> wrote:
> Use the User-Agent header (e.g http://en.wikipedia.org/wiki/User_agent).
>
> Kalle
>
>
> On Thu, Aug 19, 2010 at 10:48 PM, Omar Carvajal
> <tapes...@carvajalonline.com> wrote:
>> Hey all,
>>
>> I wanted to know if there was a way to get my app to call different pages
>> depending on the browser that is being used.
>>
>> For example if the application is being accessed from an iPhone, it should
>> go to the page /mobile for example. And if FireFox is used, it should load
>> /desktop.
>>
>> How could I achieve this?
>>
>> Thanks in advance,
>>
>> Omar
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to