A lightweight MVC framework implemented from scratch to understand the core concepts of web frameworks.
This project is a simplified MVC framework implementation that demonstrates the fundamental concepts of web frameworks. It includes:
- Request dispatching
- Annotation-based routing
- View rendering with Pebble template engine
- Session management
- JSON processing
@GetMappingand@PostMappingannotations for route mapping- Automatic parameter binding
- Template-based view rendering
- Session management
- JSON request/response handling
- Java 8+
- Servlet API
- Embedded Tomcat
- Pebble Template Engine
- Jackson
- Maven
- Clone the repository
- Open the project in your IDE (e.g., IntelliJ IDEA, Eclipse)
- Run
Main.javadirectly
- Clone the repository
- Build with Maven:
mvn clean package - Deploy the generated WAR file to your web server (e.g., Tomcat)
- Access the application at
http://localhost:8080
For detailed documentation and implementation details, please visit my blog post: 从零开始手搓一个MVC框架
MIT License