标签:www url 第一个 rri 注解 依赖 方法 ping 手写
分为配置、初始化、运行三个阶段如下图
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"> <display-name>HandWriting Web Application</display-name> <servlet> <servlet-name>HandWriting MVC</servlet-name> <servlet-class>com.wbg.framework.webmvc.servlet.HandWritingServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>application.properties</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HandWriting MVC</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app>
package com.wbg.framework.webmvc.servlet; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class HandWritingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { } @Override public void init(ServletConfig config) throws ServletException { super.init(config); } }
标签:www url 第一个 rri 注解 依赖 方法 ping 手写
原文地址:https://www.cnblogs.com/weibanggang/p/11876275.html