封装过程:

1、建立一个web工程

  新建一个index.jsp;

 1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     <meta http-equiv="pragma" content="no-cache">
14     <meta http-equiv="cache-control" content="no-cache">
15     <meta http-equiv="expires" content="0">    
16     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17     <meta http-equiv="description" content="This is my page">
18     <!--
19     <link rel="stylesheet" type="text/css" href="styles.css">
20     -->
21   </head>
22   
23   <body>
24     This is my mmzs JSP page. <br>
25   </body>
26 </html>
index.jsp

相关文章:

  • 2021-11-23
  • 2022-01-05
  • 2021-11-23
  • 2021-12-29
  • 2021-07-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-10
  • 2021-07-19
  • 2021-11-28
  • 2021-05-18
  • 2021-11-26
  • 2021-04-21
  • 2022-02-16
相关资源
相似解决方案