# baseservlet_demo **Repository Path**: li9699/baseservlet_demo ## Basic Information - **Project Name**: baseservlet_demo - **Description**: 简单通用Servlet分发器框架 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-26 - **Last Updated**: 2025-07-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: javaWEB, Servlet ## README This project is a Java-based web application framework implementation, providing a simple and intuitive way to handle HTTP requests and responses. It includes custom servlet handling, request routing, and method mapping functionalities. --- ### 📌 Features - **Custom Dispatcher Servlet**: Handles incoming HTTP requests and routes them to appropriate servlets. - **Request Mapping**: Maps URLs to specific methods in servlet classes. - **Modular Servlets**: Includes example servlets for user and order management. - **Support for JSP**: Includes JSP files for rendering dynamic web content. --- ### 📁 Project Structure - **`src/com/lixw/regexp/RegExp03.java`**: Demonstrates regular expression usage. - **`src/com/lixw/servlet/DispatcherServletHandler.java`**: Core servlet that routes requests to appropriate handlers. - **`src/com/lixw/servlet/OrderServlet.java`**: Handles order-related operations like add and update. - **`src/com/lixw/servlet/UserServlet.java`**: Manages user-related actions such as login and registration. - **`src/com/lixw/servlet/ServletResult.java`**: Interface defining the result contract for servlet operations. - **`web/index.jsp`, `web/2222.jsp`**: JSP files for web interface rendering. - **`web/WEB-INF/web.xml`**: Configuration file for servlet deployment. --- ### 🚀 Getting Started #### Prerequisites - Java Development Kit (JDK) 8 or higher - Apache Tomcat or any compatible servlet container - Maven or Gradle (for dependency management, if applicable) #### Build & Deployment 1. Clone the repository: ```bash git clone https://gitee.com/li9699/baseservlet_demo ``` 2. Build the project using Maven: ```bash mvn clean package ``` 3. Deploy the WAR file to your servlet container (e.g., Tomcat). 4. Start the server and access the application via: ``` http://localhost:8080/baseservlet_demo ``` --- ### 🧪 Example Usage - **User Registration**: `http://localhost:8080/user/regist` - **User Login**: `http://localhost:8080/user/login` - **Order Addition**: `http://localhost:8080/order/add` - **Order Update**: `http://localhost:8080/order/update` These URLs are mapped to methods in `UserServlet` and `OrderServlet` respectively. --- ### 🤝 Contributing Contributions are welcome! Please feel free to submit issues or pull requests for improvements, bug fixes, or new features. --- ### 📄 License This project is licensed under the MIT License – see the [LICENSE](LICENSE) file for details.