From 55cc97e4fc6d9aea9364f981f77007a9b5db7296 Mon Sep 17 00:00:00 2001 From: Relism Date: Fri, 28 Feb 2025 17:23:35 +0100 Subject: [PATCH] Flash update --- flash/advanced/handler-default-implementations.md | 2 +- flash/core-concepts/request-response.md | 6 +++--- flash/core-concepts/server-router.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flash/advanced/handler-default-implementations.md b/flash/advanced/handler-default-implementations.md index 25a2b12..fe7ab39 100644 --- a/flash/advanced/handler-default-implementations.md +++ b/flash/advanced/handler-default-implementations.md @@ -120,7 +120,7 @@ public abstract class APIKeyProtectedHandler extends RequestHandler { Now, your API handler implementation only need to extend APIKeyProtectedHandler, ensuring every request has a valid API key before executing its logic: ```java -@RouteInfo(method = HttpMethod.GET, path = "/data") +@RouteInfo(endpoint = "/data", method = HttpMethod.GET) public class GetDataHandler extends APIKeyProtectedHandler { public GetDataHandler(Request req, Response res) { super(req, res); diff --git a/flash/core-concepts/request-response.md b/flash/core-concepts/request-response.md index 0d2f34f..52e8ac6 100644 --- a/flash/core-concepts/request-response.md +++ b/flash/core-concepts/request-response.md @@ -51,7 +51,7 @@ The `ExpectedRequestParameter`, `ExpectedBodyField`, and `ExpectedBodyFile` inst You can use the getter methods to safely get the parameter value, such as `getString`, `getInt`, `getDouble`, and `getBoolean` methods to safely cast the parameter to the expected type. ```java{4,8,18,21} -@RouteInfo(method = HttpMethod.GET, path = "/hello") +@RouteInfo(endpoint = "/hello", method = HttpMethod.GET) public class MyHandler extends RequestHandler { // Store the expected parameter in a private field private final ExpectedRequestParameter myExpectedReqParam; @@ -85,7 +85,7 @@ Visiting `/hello?myParam=John` from your browser, will return `Hello, John!`. You can use the getter methods to safely get the field value, such as `getString`, `getInt`, `getDouble`, and `getBoolean` methods to safely cast the field to the expected type. ```java{4,8,18,21} -@RouteInfo(method = HttpMethod.GET, path = "/helloBody") +@RouteInfo(endpoint = "/helloBody", method = HttpMethod.GET) public class MyHandler extends RequestHandler { // Store the expected field in a private field private final ExpectedBodyField myExpectedBodyField; @@ -124,7 +124,7 @@ The methods provided by this object are slightly different from the other two, b - `getInputStream()` returns an `InputStream` object containing the file's contents. ```java{4,8,18,21} -@RouteInfo(method = HttpMethod.POST, path = "/helloFile") +@RouteInfo(endpoint = "/helloFile", method = HttpMethod.POST) public class MyHandler extends RequestHandler { // Store the expected file in a private field private final ExpectedBodyFile myExpectedBodyFile; diff --git a/flash/core-concepts/server-router.md b/flash/core-concepts/server-router.md index 54e0581..c0804fa 100644 --- a/flash/core-concepts/server-router.md +++ b/flash/core-concepts/server-router.md @@ -33,7 +33,7 @@ public class Example { ```java{3} // MyHandler.java -@RouteInfo(method = HttpMethod.GET, path = "/hello") +@RouteInfo(endpoint = "/hello", method = HttpMethod.GET) public class MyHandler extends RequestHandler { public MyHandler(Request req, Response res) { super(req, res);