JSTL代替Java代码的书写方式

参考资料
1 JSTL详解
http://blog.csdn.net/bubei/article/details/2108766
1 代替java代码中的basepath
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

用jstl代替为:
${pageContext.request.scheme}://
${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/

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