Request in java gets path related parameters

*、request.getContextPath();

What gets is: /+ project folder name

 

*、request.getScheme();

What is obtained is: protocol name such as http

 

*、request.getServerName();

What is obtained is: service name or domain name

 

*、request.getServerPort();

What is obtained is: the port number of the server

 

*, Get the parameter information in the xml file in the java class

request.getSession().getServletContext().getInitParameter(key);

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326534966&siteId=291194637