Plugins You can find out about all the publicly available Grails plugins.

Spring Mobile Plugin

3 votes
compile "org.grails.plugins:spring-mobile:1.1.3"

 Documentation  Source  Issues


Device resolver based on the Spring Mobile Library



This plugin is a wrapper around the Spring Mobile Project . The main feature is the detection of mobile devices for incoming HTTP requests.


The plugin adds dynamic methods to your controllers to determine what type of client is accessing the app:

isMobile() will be true if the client is a mobile phone.

isTablet() will be true if the client is a tablet.

isNormal() will be true if the client is not a mobile phone or tablet.

Additionally, you can run code conditionally, with access to the current instance, with this method:

withMobileDevice(Closure closure)

def list() {
   def view = "list"
   withMobileDevice { device ->
      view = "mobileList"
   render(view: view, model: [list: listInstance])

By default the deviceResolver bean is an instance of but you can create your own and override the plugin's in grails-app/conf/spring/resources.groovy e.g.


Due to license changes, WURFL support was removed in version 0.5 of the plugin