A Java-based lightweight web container designed to serve web applications with a servlet engine, offering a simplified alternative to traditional Java EE containers.
JWebtainer
is a minimalist, Java-native web container built from the ground up using modern Java features.
JWebtainer
focuses on servlet-based application isolation, modular web app deployment, and HTTP service management in
pure Java. It aims to provide a lightweight, embeddable alternative to full-fledged servlet containers like Tomcat or Jetty.
- Java 17
- Gradle
- JUnit 5
- Java JDK 17 or later
- Gradle 7.x or later
- Git
- Light-weight embedded servlet container
- Web server with HTTP/1.1 support
- HTTP request/response routing
- Static resource serving
- Gradle build and test setup
- WAR-like application packaging and auto-deployment
- Custom classloader per web app
- Web application isolation
- Logging and monitoring
- Hot reload support
- Web-based admin interface
- CLI tools for deployment and management
- Clone the repository:
git clone cd JWebtainer
Just run main
method in java/deep/jwebtainer/Main.java
an on your browser http://localhost:8080/
To configure servlets in your application:
- Create a
servlet.properties
file in your application's resources directory - Add servlet mappings using the format:
servletName=fully.qualified.ClassName
myServlet=com.example.MyServlet
- Ensure your servlet class implements
HttpServlet
from the JWebtainer projectpublic class MyServlet extends HttpServlet { // Implement servlet methods }
Note: Each servlet class must implement the HttpServlet
class provided by JWebtainer to ensure proper integration with
the container.
We welcome contributions to JWebtainer! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m "Add your feature description"
- Push your changes to your fork:
- Push to the branch:
git push origin feature/your-feature-name
- Create a pull request against the
main
branch of the original repository. - Ensure your code adheres to the project's coding standards and includes tests for new features or bug fixes.
- Wait for review and address any feedback provided by the maintainers.
- Once approved, your changes will be merged into the main branch.
- Update the documentation if necessary, especially if you added new features or changed existing functionality.
This project is licensed under the MIT License.
For any questions, suggestions, or issues, please open an issue on the GitHub repository or contact the maintainers via email.