This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onErrorResponse(VolleyError error) { | |
int statusCode = error.networkResponse.statusCode; | |
NetworkResponse response = error.networkResponse; | |
Log.d("testerror",""+statusCode+" "+response.data); | |
// Handle your error types accordingly.For Timeout & No connection error, you can show 'retry' button. | |
// For AuthFailure, you can re login with user credentials. | |
// For ClientError, 400 & 401, Errors happening on client side when sending api request. | |
// In this case you can check how client is forming the api and debug accordingly. | |
// For ServerError 5xx, you can do retry or handle accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package haulage.project | |
import groovyx.net.http.ContentType | |
import groovyx.net.http.HTTPBuilder | |
import groovyx.net.http.HttpResponseException | |
import static javax.servlet.http.HttpServletResponse.* | |
class CustomRestInterceptor { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grails.util.TypeConvertingMap | |
import grails.web.mapping.UrlMapping | |
import org.springframework.web.servlet.support.RequestContextUtils | |
class BootstrapTagLib { | |
static namespace = "boots" | |
Closure paginate = { Map attrsMap -> | |
TypeConvertingMap attrs = (TypeConvertingMap)attrsMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
micronaut: | |
application: | |
name: example-micronaut-gorm | |
dataSource: | |
pooled: true | |
dbCreate: create-drop | |
url: jdbc:h2:mem:devDb | |
driverClassName: org.h2.Driver | |
username: sa | |
password: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install SDKMAN | |
curl -s "https://get.sdkman.io" | bash | |
source "$HOME/.sdkman/bin/sdkman-init.sh" | |
sdk version | |
2. Install Micronaut through sdk command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.micronaut.gorm.controller | |
import example.micronaut.gorm.domain.Person | |
import example.micronaut.gorm.service.PersonService | |
import io.micronaut.http.HttpResponse | |
import io.micronaut.http.annotation.Controller | |
import io.micronaut.http.annotation.Delete | |
import io.micronaut.http.annotation.Get | |
import io.micronaut.http.annotation.Post | |
import io.micronaut.http.annotation.Put |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.micronaut.gorm | |
import example.micronaut.gorm.domain.Person | |
import example.micronaut.gorm.service.PersonService | |
import io.micronaut.context.event.StartupEvent | |
import io.micronaut.runtime.event.annotation.EventListener | |
import javax.inject.Singleton | |
@Singleton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.micronaut.gorm.service | |
import example.micronaut.gorm.domain.Person | |
import grails.gorm.services.Service | |
import groovy.transform.CompileStatic | |
import javax.inject.Singleton | |
@Service(Person) | |
@CompileStatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.micronaut.gorm.service | |
import example.micronaut.gorm.domain.Person | |
import grails.gorm.services.Service | |
import groovy.transform.CompileStatic | |
import javax.inject.Singleton | |
@Service(Person) | |
@CompileStatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.micronaut.gorm.domain | |
import grails.gorm.annotation.Entity | |
@Entity | |
class Person { | |
String name | |
String email |
NewerOlder