C标签和S标签
来源:互联网 发布:java判断上传文件类型 编辑:程序博客网 时间:2024/06/05 09:49
SpringMVC 自带标签没有Struts2的好用。。。
1.使用s:if判断字符串
2.s:if判断null
3.c:if判断是否为null
- <s:if test="name!='doom'">
- .....
- </s:if>
- <s:else>
- ....
- </s:else>
2.s:if判断null
- <s:if test="list!=null && list.size!=0">
- <table border="1">
- <tr><td>table1</td><tr>
- <s:iterator value="list" id="u" status="st">
- <tr>
- <td><s:property value="#st.index" /></td>
- <td> <s:property value="[color=red]#u.id[/color]"/></td>
- <td> <s:property value="[color=red]username[/color]"/></td>
- <td> <s:property value="password"/></td>
- <tr>
- </s:iterator>
- </table>
- </s:if>
3.c:if判断是否为null
- <c:if test="${!empty list}">
- <table border="1">
- <tr><td colspan="3">table2</td><tr>
- <c:forEach var="u" items="${list}" varStatus="sta">
- <tr>
- <td>${sta.index}</td>
- <td align="center"> ${u.id} </td>
- <td align="center"> ${u.username } </td>
- <td align="center"> ${u.password} </td>
- </tr>
- </c:forEach>
- </table>
- </c:if>
4.c:标签没有 else标签 可以通过 c:choose c:when c:otherwise实现
- <tr>
<td>学历</td>
<td>
<select name="education">
<c:if test="${employ.education==null }">
<option value="" selected="selected">请选择</option>
</c:if>
<c:choose>
<c:when test="${employ.education=='高中'}">
<option value="高中" selected="selected">高中</option>
</c:when>
<c:otherwise>
<option value="高中">高中</option>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${employ.education=='大专'}">
<option value="大专" selected="selected">大专</option>
</c:when>
<c:otherwise>
<option value="大专">大专</option>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${employ.education=='本科'}">
<option value="本科" selected="selected">本科</option>
</c:when>
<c:otherwise>
<option value="本科">本科</option>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${employ.education=='研究生'}">
<option value="研究生" selected="selected">研究生</option>
</c:when>
<c:otherwise>
<option value="研究生">研究生</option>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${employ.education=='博士'}">
<option value="博士" selected="selected">博士</option>
</c:when>
<c:otherwise>
<option value="博士">博士</option>
</c:otherwise>
</c:choose>
</select>
</td>
</tr>
0 0
- C标签和S标签
- JSTL c标签和Struts2 s标签常用功能对比
- <s:if>标签和<c:if>标签的一点区别
- JSTL(c标签)与Struts2(s标签)标签
- JSTL(c标签)与Struts2(s标签)标签
- C标签和s标签的对比,特别是里面的if判断条件的写法
- C标签和s标签的对比,特别是里面的if判断条件的写法
- Struts2中s:set标签和s:if标签小结
- Struts2中s:set标签和s:if标签
- <s:radio>标签和<s:checkboxlist>标签实现换行
- Struts2中s:set标签和s:if标签小结
- s标签
- S标签
- Struts标签<s:property和<s:if
- strut2标签s:set和s:if
- struts2 <s:radio> 和 <s:select>标签
- Struts中S标签与C标签用法
- js中使用s(c)标签
- 安装jdk后使用Eclipse遇到无法启动问题解决办法
- Android 尺寸大小单位px和dip ,sp之间的互相转换
- 程序员转型IT讲师的优势
- 防止表单提交的
- CSS3 属性学习
- C标签和S标签
- ajax跨域aspnet解决方式
- Linux Oracle服务启动&停止脚本与开机自启动
- js push join
- linux c学习笔记----TCP基础客户/服务编程(socket,bind等)
- Ubuntu 下配置Zorka 对Tomcat监控
- Yarn 内存分配管理机制及相关参数配置
- Java基础:其他对象
- 多线程编程