开发者

Mobile User Interface for EAR

开发者 https://www.devze.com 2023-03-11 15:50 出处:网络
I have a Java EE ear project (ejb module + war). In the war I use JSF + prim开发者_开发百科efaces. Now I need to add a mobile user interface (using primefaces mobile). I have to create a new war, righ

I have a Java EE ear project (ejb module + war). In the war I use JSF + prim开发者_开发百科efaces. Now I need to add a mobile user interface (using primefaces mobile). I have to create a new war, right? If that's so, I guess the 2 wars will have different URLs. Is there a way I can redirect a cellphone trying to access the URL with web interface to the URL with the mobile interface?

Thanks! Damian


PrimeFaces is just a taglib isn't it, with the components backing it in the JAR. So you should be able to use the same WAR and same FacesServlet irrespective of whether you are serving mobile pages or desktop pages i.e. PrimeFaces mobile and PrimeFaces should be able to co-exist in the same WAR AFAIK.

You can redirect to your mobile site based on the "User-Agent" http header. There are loads of examples about this on the Internet and some pre-existing code. So detect this and issue the redirect to your mobile site as neccessary e.g. mysite/mobile.

0

精彩评论

暂无评论...
验证码 换一张
取 消