diff --git a/.idea/misc.xml b/.idea/misc.xml
index 217a1af..3462391 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -4,7 +4,7 @@
-
+
\ No newline at end of file
diff --git a/src/main/java/dev/coph/nextusweb/server/annotation/AnnotationScanner.java b/src/main/java/dev/coph/nextusweb/server/annotation/AnnotationScanner.java
index ef1f7d7..20ae8b1 100644
--- a/src/main/java/dev/coph/nextusweb/server/annotation/AnnotationScanner.java
+++ b/src/main/java/dev/coph/nextusweb/server/annotation/AnnotationScanner.java
@@ -21,11 +21,10 @@ public final class AnnotationScanner {
public static void register(Router router, Object controller) {
Class> clazz = controller.getClass();
Controller ctrlAnno = clazz.getAnnotation(Controller.class);
- if (ctrlAnno == null) {
- throw new IllegalArgumentException(
- clazz.getName() + " ist nicht mit @Controller annotiert");
+ String prefix = "";
+ if (ctrlAnno != null) {
+ prefix = normalizePrefix(ctrlAnno.value());
}
- String prefix = normalizePrefix(ctrlAnno.value());
for (Method method : clazz.getDeclaredMethods()) {
RouteInfo info = extractRoute(method);
@@ -48,11 +47,10 @@ public final class AnnotationScanner {
String fullPath = prefix + normalizePath(info.path());
router.register(HttpMethod.valueOf(info.method()), fullPath, handler);
- System.out.printf("Registered: %-6s %-30s -> %s.%s%n",
- info.method(), fullPath, clazz.getSimpleName(), method.getName());
+ System.out.printf("Registered: %-6s %-30s -> %s.%s%n", info.method(), fullPath, clazz.getSimpleName(), method.getName());
} catch (IllegalAccessException e) {
- throw new RuntimeException("Konnte Methode nicht registrieren: " + method, e);
+ throw new RuntimeException("Could not register method: " + method, e);
}
}
}