This project is a very small example of how to use asynchronous servlets in Java. It demonstrates how to handle long-running tasks without blocking the servlet container's threads. This project was created as part of a blog post on Async responses with Servlet.
Here is what this project includes:
- HelloServlet: A simple servlet that handles GET requests asynchronously.
- HelloServletComet: A servlet that simulates a long-running task.
- HelloServletSync: A synchronous version of the HelloServlet for comparison.
- MultipartMixedServlet: A servlet that generates multipart/mixed responses.
- Java 21
- Maven
To build the project, navigate to the project directory and run:
mvn clean packageYou can run the project using the following command:
java -jar target/asyncservlet-1.0-SNAPSHOT-shaded.jar