diff options
Diffstat (limited to 'juick-spring-www/src/main/java/com/juick/www/helpers')
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/helpers/QueryString.java | 14 | ||||
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/helpers/QueryStringResolver.java | 31 |
2 files changed, 0 insertions, 45 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/helpers/QueryString.java b/juick-spring-www/src/main/java/com/juick/www/helpers/QueryString.java deleted file mode 100644 index 0eb6c76f..00000000 --- a/juick-spring-www/src/main/java/com/juick/www/helpers/QueryString.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.juick.www.helpers; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Created by vt on 22/03/16. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.PARAMETER) -public @interface QueryString { -}
\ No newline at end of file diff --git a/juick-spring-www/src/main/java/com/juick/www/helpers/QueryStringResolver.java b/juick-spring-www/src/main/java/com/juick/www/helpers/QueryStringResolver.java deleted file mode 100644 index 812c4497..00000000 --- a/juick-spring-www/src/main/java/com/juick/www/helpers/QueryStringResolver.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.juick.www.helpers; - -import org.springframework.core.MethodParameter; -import org.springframework.web.bind.support.WebDataBinderFactory; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.web.method.support.ModelAndViewContainer; - -import javax.servlet.http.HttpServletRequest; -import java.lang.annotation.Annotation; -import java.util.Optional; - -public class QueryStringResolver implements HandlerMethodArgumentResolver { - @Override - public boolean supportsParameter(MethodParameter parameter) { - Annotation[] parameterAnnotations = parameter.getParameterAnnotations(); - for (Annotation parameterAnnotation : parameterAnnotations) { - if (QueryString.class.isInstance(parameterAnnotation)) { - return true; - } - } - - return false; - } - - @Override - public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { - HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class); - return Optional.ofNullable(request.getQueryString()); - } -}
\ No newline at end of file |