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能连接到
本文来自博客园,作者:金玉良猿,转载请注明原文链接:https://www.cnblogs.com/LLFA/p/14407400.html

浙公网安备 33010602011771号