在jsp页面中获取项目名称

java代码
		String path = request.getContextPath();
		String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
		//System.out.println("basePath = " + basePath);
		//System.out.println(request.getContextPath());
	

el表达式:${pageContext.request.contextPath}

你可能感兴趣的:(java,jsp)