Hello,
I'm using for the first time Spring Mobile, works great so far.
Just one question though.
In my webapp, I'm using :
I want to decline the login page for mobiles, so I create login-mobile.jsp.Code:<mvc:view-controller path="/login"/>
Now, I want mvc:view-controller to display login.jsp for desktop application and login-mobile.jsp for mobile application.
Only way to do that is to remove the mvc:view-controller and create a custom controller like this :
Is there an easier way ?Code:@Controller public class LoginController { @RequestMapping("/login") public String login(Device device) { if (device.isMobile()) { return "login-mobile"; } else { return "login"; } } }
Otherwise should I create a JIRA issue to ask for adding something like :
<mvc:mobile-view-controller path="/login"/> ?
Thanks for the help !
P.S. this thread is quite similar, but no JIRA found : http://forum.springsource.org/showth...iew-controller


Reply With Quote