asasa

class LoginController {

  def index = { }

  def login = {
    def loginDevice = Device.findByDeviceIdAndDevicePassword(params.deviceId, params.devicePassword)
    if (loginDevice) {
      render(contentType: "text/xml") {
        loginResult {
          result('success')
          loginDeviceInfo(deviceId: params.deviceId, devicePassword: params.devicePassword)
        }
      }
    }
    else {
      render(contentType: "text/xml") {
        loginResult{
          result('failure')
          reason('no such device or password not match');
        }
      }
    }
  }
}

你可能感兴趣的:(java,xml)