jsp 加载公用js

jsp 加载公用js_第1张图片

common.jsp

<%

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

    request.setAttribute("basePath", basePath);

%>

页面引用

link rel="stylesheet" type="text/css" href="${basePath}/css/jquery.validate.css"

你可能感兴趣的:(jsp 加载公用js)