Thanks guys! That did it, I just created a dispatcher service that checks the User Agent and from there I redirect the user to the page he needs to go. I knew I had to check the User Agent header, I just didn't know where to do it.
Omar On Fri, 20 Aug 2010 09:43:38 +0200, "Joost Schouten (mailing lists)" <joost...@jsportal.com> wrote: > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org