字符 | 转义码 | |
& 符号 | & | & |
单引号 | ' | ' |
双引号 | " | " |
大于 | > | > |
小于 | < | < |
<logic:present name="AppList">
<logic:iterate id="appParam" type="com.ntas.netmanage.ParamSetEquipPsword" name="AppList">
<tr>
<td nowrap><-----></td>
</tr>
</logic:iterate>
</logic:present>
如果,前台输入了 ‘>’ 等字符时:
1)<%= appParam.getPsword()%>
对于以上述方式显示相关属性的方法,查看页面源文件可得知“<td nowrap>ë”,其对应的转义字符正是‘>’。
2)<bean:write name="appParam" property="psword"/>
改用上述方法进行实现,查看源文件得知“<td nowrap>&gt;”,此时会将&进行转义,这样前台就会得到正确的显示了。