package com.bjsxt.com;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MyServlet11 extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// System.out.println("MyServlet11.service()");
//获取path路径
//path路径为项目的虚拟项目名
String path = req.getContextPath();
System.out.println("path的路径为:——>"+path);
//获取schema路径
//schema为项目前边的http
String scheme = req.getScheme();
System.out.println("schema——>"+scheme);
//获取serverName
//serverName为服务器名称,也就是项目所在服务器的本地ip地址
String serverName = req.getServerName();
System.out.println("servername——>"+serverName);
//获取serverport
//serverPort是项目中的访问端口号
in
jps文件路径梳理
最新推荐文章于 2024-06-15 16:39:10 发布