diff --git a/src/main/java/spring/mvc/annotation/Controller.java b/src/main/java/spring/mvc/annotation/Controller.java new file mode 100644 index 0000000..6e8f2f2 --- /dev/null +++ b/src/main/java/spring/mvc/annotation/Controller.java @@ -0,0 +1,12 @@ +package spring.mvc.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface Controller { + String value() default ""; +} \ No newline at end of file diff --git a/src/main/java/spring/mvc/annotation/RequestMapping.java b/src/main/java/spring/mvc/annotation/RequestMapping.java new file mode 100644 index 0000000..83ca424 --- /dev/null +++ b/src/main/java/spring/mvc/annotation/RequestMapping.java @@ -0,0 +1,16 @@ +package spring.mvc.annotation; + +import spring.mvc.handler.mapping.RequestMethod; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface RequestMapping { + String value() default ""; + + RequestMethod method() default RequestMethod.GET; +}