由于老没开发框架了,今天提取公共省市县三级联动组件时,使用jsp传参搞了半天才弄出来。

组件代码

 $(function(){console.log("${param.init}");
<c:if test="${param.init}">
<c:if test="${not empty data && not empty data.province}">
var address = {
province : "${data.province}",
city : "${data.city}",
coll : "${data.coll}",
detailAddress : "${data.detailAddress}"
};
</c:if>
setAddress(address);
</c:if>
});
function setAddress(address) {
window.initSelect(1, 'province','${adminPath}/basic/usualaddress/regionSelect');
if(address && address.province) {
window.$("#province").val(address.province);
window.changCity('${adminPath}/basic/usualaddress/regionSelect');
window.$("#city").val(address.city);
window.changColl('${adminPath}/basic/usualaddress/regionSelect');
window.$("#coll").val(address.coll);
window.$("#detailAddress").val(address.detailAddress);
}
}

调用

 <jsp:include page="../../common/address.jsp">
<jsp:param name="init" value="true" />
</jsp:include>

EL表达式判断规范

test="${条件要写在大括号里面}"

错误案例:test="${param.init} == true";

应为:test="${param.init == true}";

EL表达式判断条件要写在${}内的更多相关文章

  1. el表达式 多条件判断

      el表达式 多条件判断 CreationTime--2018年9月13日08点59分 Author:Marydon 1.情景展示 ACCESS_ID == 'APP1039' 且 CARDTYPE ...

  2. el表达式判断字符串相等

    el表达式判断字符串相等 Java code 1 ${"a" == "a"}  ${"b" eq "b"}  都可以 & ...

  3. [转]EL表达式判断是否为空,判断是否为空字符串

    原文地址:https://blog.csdn.net/zhaofuqiangmycomm/article/details/79442730 El表达式判断是否为空字符串 ${empty 值}  返回t ...

  4. EL表达式多条件或判断用法

    简单记录一EL表达式的判断用法 <c:if test="${(order.status == '06'&& order.type=='02') || (order.st ...

  5. EL表达式判断不能为空

    前几天在做一个网站的时候遇到一个问题,要判断一个在request或者session域里面的对象是否为空,利用EL表达式,正常思维就是用 <c:if test="${* != null} ...

  6. 【JSP EL】el表达式判断是否为null

    后台程序放入Model中,从前台el表达式取出来非常方便,但是如果需要处理 当数据为null的时候,怎么办,不为null的时候,怎么办:这个怎么处理呢? <span class="us ...

  7. EL表达式多条件判断方式

    <td> <c:forEach items="${cityMap}" var="entry"> <hr> <input ...

  8. EL表达式多条件判断

    ${bndExport.containerList[0].kind eq '01' || bndExport.containerList[0].kind eq '02'}

  9. 实战3--应用EL表达式判断用户登录信息

    1.判断用户名是否为空,空则显示提示信息 (1)编写index.jsp页面 <%@ page language="java" contentType="text/h ...

随机推荐

  1. cocos2dx游戏--欢欢英雄传说--添加人物

    接下来需要导入精灵帧资源,因为之前下载了TexturePacker,然后通过TexturePacker的"Publish sprite sheet"方法可以生成一个.pvr.ccz ...

  2. Android Intent实现页面之间跳转

    什么是IntentIntent可以理解为信使(意图)由Intent来协助完成Android各个组件之间的通讯Intent实现页面逐渐的跳转1.startActivity(inetnt)2.startA ...

  3. windbg载入目标模块pdb

    .reload /f xxxx.dll ld xxxx 以kdcom为例子 .reload /f kdcom.dll ld kdcom 二选一

  4. poj_3274 哈希

    哈希 Hash 哈希是一种将复杂数据转换为线性数据从而可以进行随机访问的查找算法. 哈希经常用于对复杂数据(如结构体.对象等)的查找,在使用的时候,需要定义一个Hash函数,将需要查找的复杂对象转化为 ...

  5. LeetCode - Nth Highest Salary

    题目大概意思是要求找出第n高的Salary,直接写一个Function.作为一个SQL新手我学到了1.SQL中Function的写法和变量的定义,取值.2.limit查询分    页的方法. 在这个题 ...

  6. [Music] Billboard Hot 100 Singles Chart 27th Jun 2015

    01 Wiz Khalifa - See You Again (Feat. Charlie P..> 30-Jul-2015 09:12 9247814 02 Taylor Swift - Ba ...

  7. oracle的分页查询,mabatis的sql配置

    <select id="getCardcaseByPage" resultType="Cardcase" > select * from ( sel ...

  8. Shell--基础知识

    变量的定义: a=1 b=hello c="hello world !" d='hello "反启" !' e=`ls`  (注意:这是反引号) 备注:=号左右 ...

  9. Oracle之rman命令的使用(51CTO风哥rman课程)

    看rman的连接串的帮助 连接数据库 rman target/ rman的版本要和目标数据库一致(一般大版本可以往下兼容小版本) 运行操作系统命令 run {host "pwd"; ...

  10. Augmented reality in natural scenes

    Augmented reality in natural scenes (Iryna Gordon and David Lowe)2006年关于AR的研究成果 项目主页 http://www.cs.u ...