diff --git a/README.md b/README.md index 13c4453..49c5d5a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ The defaults are `httpStatus = HttpStatus.INTERNAL_SERVER_ERROR` and `contentTyp The custom message is taken from the custom annotation class itself, so any parameters you'd like to insert need to be handled there. -Make sure to add `com.raychatter.common.annotation.AnnotationHandler` as a bean in your XML. +Make sure to add `` to your XML. + And that's it! - - diff --git a/exception-handler/src/main/java/com/raychatter/common/annotation/AnnotationHandler.java b/exception-handler/src/main/java/com/github/raychatter/AnnotationHandler.java similarity index 98% rename from exception-handler/src/main/java/com/raychatter/common/annotation/AnnotationHandler.java rename to exception-handler/src/main/java/com/github/raychatter/AnnotationHandler.java index 353b05f..1d793e5 100644 --- a/exception-handler/src/main/java/com/raychatter/common/annotation/AnnotationHandler.java +++ b/exception-handler/src/main/java/com/github/raychatter/AnnotationHandler.java @@ -1,4 +1,4 @@ -package com.raychatter.common.annotation; +package com.github.raychatter; import org.springframework.core.io.ClassPathResource; import org.springframework.http.HttpStatus; diff --git a/exception-handler/src/main/java/com/raychatter/common/annotation/ExceptionHandler.java b/exception-handler/src/main/java/com/github/raychatter/ExceptionHandler.java similarity index 92% rename from exception-handler/src/main/java/com/raychatter/common/annotation/ExceptionHandler.java rename to exception-handler/src/main/java/com/github/raychatter/ExceptionHandler.java index 0602a00..f579aa5 100644 --- a/exception-handler/src/main/java/com/raychatter/common/annotation/ExceptionHandler.java +++ b/exception-handler/src/main/java/com/github/raychatter/ExceptionHandler.java @@ -1,4 +1,4 @@ -package com.raychatter.common.annotation; +package com.github.raychatter; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/exception-handler/src/test/java/com/raychatter/common/annotation/AnnotationHandlerTest.java b/exception-handler/src/test/java/com/github/raychatter/AnnotationHandlerTest.java similarity index 99% rename from exception-handler/src/test/java/com/raychatter/common/annotation/AnnotationHandlerTest.java rename to exception-handler/src/test/java/com/github/raychatter/AnnotationHandlerTest.java index 83e35f4..e2b7327 100644 --- a/exception-handler/src/test/java/com/raychatter/common/annotation/AnnotationHandlerTest.java +++ b/exception-handler/src/test/java/com/github/raychatter/AnnotationHandlerTest.java @@ -1,4 +1,4 @@ -package com.raychatter.common.annotation; +package com.github.raychatter; import junit.framework.Assert; import org.junit.Test; diff --git a/sample/src/main/java/com/raychatter/common/controller/HelloController.java b/sample/src/main/java/com/github/raychatter/common/controller/HelloController.java similarity index 78% rename from sample/src/main/java/com/raychatter/common/controller/HelloController.java rename to sample/src/main/java/com/github/raychatter/common/controller/HelloController.java index e3dfbe0..93e4e98 100755 --- a/sample/src/main/java/com/raychatter/common/controller/HelloController.java +++ b/sample/src/main/java/com/github/raychatter/common/controller/HelloController.java @@ -1,7 +1,7 @@ -package com.raychatter.common.controller; +package com.github.raychatter.common.controller; -import com.raychatter.common.exception.MyNegativeArraySizeException; -import com.raychatter.common.exception.CustomException; +import com.github.raychatter.common.exception.MyNegativeArraySizeException; +import com.github.raychatter.common.exception.CustomException; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/sample/src/main/java/com/raychatter/common/exception/CustomException.java b/sample/src/main/java/com/github/raychatter/common/exception/CustomException.java similarity index 71% rename from sample/src/main/java/com/raychatter/common/exception/CustomException.java rename to sample/src/main/java/com/github/raychatter/common/exception/CustomException.java index b7c3157..84d425f 100644 --- a/sample/src/main/java/com/raychatter/common/exception/CustomException.java +++ b/sample/src/main/java/com/github/raychatter/common/exception/CustomException.java @@ -1,6 +1,6 @@ -package com.raychatter.common.exception; +package com.github.raychatter.common.exception; -import com.raychatter.common.annotation.ExceptionHandler; +import com.github.raychatter.ExceptionHandler; import org.springframework.http.HttpStatus; @ExceptionHandler(httpStatus = HttpStatus.NOT_FOUND, contentType = "text/html") diff --git a/sample/src/main/java/com/raychatter/common/exception/MyNegativeArraySizeException.java b/sample/src/main/java/com/github/raychatter/common/exception/MyNegativeArraySizeException.java similarity index 75% rename from sample/src/main/java/com/raychatter/common/exception/MyNegativeArraySizeException.java rename to sample/src/main/java/com/github/raychatter/common/exception/MyNegativeArraySizeException.java index e7cf265..b086522 100644 --- a/sample/src/main/java/com/raychatter/common/exception/MyNegativeArraySizeException.java +++ b/sample/src/main/java/com/github/raychatter/common/exception/MyNegativeArraySizeException.java @@ -1,6 +1,6 @@ -package com.raychatter.common.exception; +package com.github.raychatter.common.exception; -import com.raychatter.common.annotation.ExceptionHandler; +import com.github.raychatter.ExceptionHandler; import org.springframework.http.HttpStatus; @ExceptionHandler(httpStatus = HttpStatus.INTERNAL_SERVER_ERROR, contentType = "application/json") diff --git a/sample/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml b/sample/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml index 2ec066d..ffb39db 100755 --- a/sample/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml +++ b/sample/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml @@ -8,7 +8,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - + @@ -20,6 +20,6 @@ - + \ No newline at end of file