encodeURIComponent传入后台解码
来源:互联网 发布:数据整合系统sci 编辑:程序博客网 时间:2024/05/30 22:45
<script>$(document).ready(function() {$("#name").focus();$("#inputForm").validate({ rules:{ code:{ required:true, rangelength:[5,10], remote:"${ctx}/sierac/product/check?oldcode=" + encodeURIComponent('${product.code}') //此处传入后台 }, name:{ required:true, rangelength:[1,10] }, shelfLife:{ required:true, digits:true }, pcsPerCtn:{ required:true, digits:true } }, messages:{ code:{ required:"产品编码不能为空", rangelength:"编码长度在5-10之间", remote:"该产品编码已经存在,请重新输入" }, name:{ required:"产品名称不能为空", rangelength:"产品名称长度介于1-10之间" }, shelfLife:{ required:"保质期不能为空", digits:"必须为整数" }, pcsPerCtn:{ required:"每箱单品数不能为空", digits:"单品数必须为整数" } },submitHandler: function(form){loading('正在提交,请稍等...');form.submit();},errorContainer: "#messageBox",errorPlacement: function(error, element) {$("#messageBox").text("输入有误,请先更正。");if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){error.appendTo(element.parent().parent());} else {error.insertAfter(element);}}});});</script>
<form:form id="inputForm" modelAttribute="product" action="${ctx}/sierac/product/save" method="post" class="form-horizontal"><form:hidden path="id"/><sys:message content="${message}"/><div class="control-group"><label class="control-label" id="code">产品代码:</label><div class="controls"> <c:choose> <c:when test="${empty product.id}"> <form:input path="code" htmlEscape="false" maxlength="255" class="input-xlarge" /> </c:when> <c:otherwise> <form:input path="code" htmlEscape="false" maxlength="255" class="input-xlarge" readonly="true" /> </c:otherwise> </c:choose><span class="help-inline"><font color="red">*</font> </span></div></div>
后台:
@ResponseBody @RequiresPermissions("sierac:product:edit") @RequestMapping(value = "check") public String check(HttpServletRequest request ,String oldcode, String code) throws UnsupportedEncodingException { String s = new String(request.getParameter("code").getBytes("ISO8859-1"), "UTF-8");//encodeURIComponent编码转换 if (s !=null && s.equals(oldcode)) {return "true";//不重复} else if (s !=null && productService.findByCode(s)==null) {return "true"; //不重复}return "false"; //重复}
0 0
- encodeURIComponent传入后台解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台的解码
- encodeURIComponent编码后java后台解码乱码的解决
- HTML encodeURIComponent编码后java后台的解码
- js中使用encodeURIComponent编码url后java后台的解码
- jquery.base64对传入后台处理的代理理行编码和后台的解码
- oracle 常用自定义函数
- 随机闹钟
- 今天第一天开博客
- Vijos 1484题:ISBN号码
- git连接GitHub
- encodeURIComponent传入后台解码
- matplotlib的基本用法(二)——设置坐标轴
- 走技术线,还是技术管理线?
- java.net.SocketException四大异常解决方案
- JVM调优
- 介绍 JSON
- Power Calculus UVA
- ThreadPoolExecutor中BlockingQueue的三种实现及排队策略
- 将list遍历出来全部删除的两种方法