Renamed the packages
This commit is contained in:
@@ -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.
|
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 `<bean id="exceptionResolver" class="com.github.raychatter.AnnotationHandler" />` to your XML.
|
||||||
|
|
||||||
And that's it!
|
And that's it!
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.raychatter.common.annotation;
|
package com.github.raychatter;
|
||||||
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.raychatter.common.annotation;
|
package com.github.raychatter;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.raychatter.common.annotation;
|
package com.github.raychatter;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.raychatter.common.controller;
|
package com.github.raychatter.common.controller;
|
||||||
|
|
||||||
import com.raychatter.common.exception.MyNegativeArraySizeException;
|
import com.github.raychatter.common.exception.MyNegativeArraySizeException;
|
||||||
import com.raychatter.common.exception.CustomException;
|
import com.github.raychatter.common.exception.CustomException;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
@@ -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;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
@ExceptionHandler(httpStatus = HttpStatus.NOT_FOUND, contentType = "text/html")
|
@ExceptionHandler(httpStatus = HttpStatus.NOT_FOUND, contentType = "text/html")
|
||||||
@@ -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;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
@ExceptionHandler(httpStatus = HttpStatus.INTERNAL_SERVER_ERROR, contentType = "application/json")
|
@ExceptionHandler(httpStatus = HttpStatus.INTERNAL_SERVER_ERROR, contentType = "application/json")
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||||
|
|
||||||
<context:annotation-config />
|
<context:annotation-config />
|
||||||
<context:component-scan base-package="com.raychatter.common.controller" />
|
<context:component-scan base-package="com.github.raychatter.common.controller" />
|
||||||
|
|
||||||
<bean
|
<bean
|
||||||
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||||
@@ -20,6 +20,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="exceptionResolver" class="com.raychatter.common.annotation.AnnotationHandler" />
|
<bean id="exceptionResolver" class="com.github.raychatter.AnnotationHandler" />
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
Reference in New Issue
Block a user