jsp引用脚本出错
在使用谷歌验证码jar包时,动态获取地址出错:
相关代码:
head.jsp <% String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/"; %> regist.jsp 引用了jstl标签库 <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ include file="/pages/common/head.jsp"%> <script type="text/javascript"> $("#code_img").click(function () { this.src = "${basrPath}/kaptcha.jpg?d=" + new Date(); }); script>
一直没找到原因。。。。。
我直接使用原生的jsp语法<%=basePath%>n能连接到