<servlet-mapping>
<servlet-name>myIndex</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
在该JSP项目的index.jsp文件中配置如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<html>
<head>
<title>config</title>
</head>
<body>
<%
String name = config.getInitParameter("name");
out.print("通过out对象打印信息:" + name + "<br>");
%>