How to set the absolute path of JSP file

Copy codeThe code is as follows:
String path = request.getContextPath();
String basePath = request.getScheme() + “://”
+ request.getServerName() + “:” + request.getServerPort()
+Path + “/”; / / return form http://localhost :8080/upload/


Copy codeThe code is as follows:

It can also be used directly in JS code

Recommended Today

Blog based on beego, go blog

Go Blog A beego based development, can quickly create personal blog, CMS system Include functions see Official website of go Demo Update log time function January 23, 2020 New top post function February 2, 2020 New custom navigation function February 4, 2020 New site announcement function February 6, 2020 New link module February […]