2019独角兽企业重金招聘Python工程师标准>>>
1、//获取参数值
${param.name}
2、//下拉框Option。EL表达式可以写在Dom元素里面
<c:forEach items="${wechatInfos}" var="wechatInfo">
<option value="${wechatInfo.wechatId}"
<c:if test="${param.wechatId==wechatInfo.wechatId}"> selected </c:if>>${wechatInfo.wechatName}</option>
</c:forEach>
3、Servlet/Struts2/SpringMvc传递值到Js中接受。(List对象)
3.1、先在后台把对象封装为JSONArray
JSONArray array = new JSONArray();
WeixinUserInfo w1 = new WeixinUserInfo();
WeixinUserInfo w2 = new WeixinUserInfo();
w1.setCity("武汉");
w2.setCity("天门");
array.add(w1);
array.add(w2);
request.setAttribute("list1", array);
3.2、在Js中把JSON字符串转为JSON对象
(其他转换方式http://my.oschina.net/u/2472104/admin/edit-blog?blog=640207)
var list1 = '${list1}';
var obj1 = eval(list1);
3.2、结果
上面是直接获取list集合,如果在js中就是对应的全类名的字符串
下面是JSON转换后的集合对象。
4、jsp页面接受后台的值(相当于直接在页面输出一个字符串)
<%= AppConfigUtils.getConfig().getString("system.themes", "default")%>
5、<jsp:include page="/hollycrm/personoa/page/index"></jsp:include>
注意<jsp:include>不能用${ctx}的绝对路径