You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-236Lines changed: 2 additions & 236 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Request Parsing Framework
2
2
3
-
Welcome to the **Request Parsing Framework**! This framework offers a streamlined approach to handling and validating HTTP requests in Java applications using custom annotations. By leveraging reflection and annotations, it simplifies the process of mapping request parameters to Java objects, supporting various data types, default values, and validation mechanisms.
3
+
Welcome to the Request Parsing Framework! This framework offers a streamlined approach to handling and validating HTTP requests in **Java servlet-based applications** that do not utilize Spring Boot's extensive support tools. By leveraging reflection and custom annotations, it simplifies the process of mapping request parameters to Java objects, supporting various data types, default values, and validation mechanisms.
4
4
5
5
## Table of Contents
6
6
@@ -15,11 +15,7 @@ Welcome to the **Request Parsing Framework**! This framework offers a streamline
15
15
-[Classes](#classes)
16
16
-[`BodyParser`](#bodyparser)
17
17
-[`RequestParser`](#requestparser)
18
-
-[Usage](#usage)
19
-
-[Defining Data Classes](#defining-data-classes)
20
-
-[Parsing Requests](#parsing-requests)
21
18
-[Testing](#testing)
22
-
-[Example](#example)
23
19
-[Contributing](#contributing)
24
20
-[License](#license)
25
21
@@ -162,8 +158,6 @@ The `BodyParser` class is responsible for parsing HTTP request bodies and mappin
162
158
-`parse(HttpServletRequest request, Class<T> clazz)`: Parses the request and populates an instance of the specified class.
163
159
-`parseToJSONObject(InputStream inputStream)`: Reads the request body and parses it into a `JSONObject`.
The `RequestParser` class provides static methods to parse HTTP request parameters into Java objects using the `@RequestParam` annotation. It offers additional flexibility and utility functions for handling different parameter types.
247
+
The `RequestParser` class provides static methods to parse HTTP request parameters into Java objects using the `@RequestParam` annotation. It offers additional flexibility and utility functions for handling different parameter types. For handle body from `x-www-form-urlencoded`, use `RequestParser` class.
254
248
255
249
**Key Methods:**
256
250
257
251
-`parseRequest(HttpServletRequest req, Class<T> clazz)`: Parses the request parameters and maps them to an instance of the specified class.
258
252
-`parseParamToList(HttpServletRequest req, String paramName, String defaultValue, boolean isRequired, Class<T> listType)`: Parses a specific parameter into a `List` of the desired type.
259
253
260
-
**Implementation:**
261
254
262
255
#### Usage Example
263
256
@@ -368,104 +361,6 @@ public class ExampleUsageWithRequestParser {
0 commit comments