Jsp后台取得网址

// 输出:http://localhost:8080/project/PayOrder.do
		logger.error("-------------- " + request.getRequestURL().toString()); 
// 输出:/PayOrder.do
		logger.error("-------------- " + request.getServletPath()); 
// 输出网址:http://localhost:8080/project
		logger.error("-------------- " + request.getRequestURL().toString().split(request.getServletPath())[0]); 

你可能感兴趣的:(jsp)