Record what you don't understand about the mall project

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

1. Several methods of request:

request.getSchema() can return the protocol used by the current page, http or https;

request.getServerName() can return the name of the server where the current page is located;

request.getServerPort() can return the port used by the server where the current page is located, which is 80;

request.getContextPath() can return the name of the application where the current page is located;


Guess you like

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