专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Html教程 » 打印字符串:把session中的某个字符串打印出来 »正文

打印字符串:把session中的某个字符串打印出来

来源: 发布时间:星期五, 2008年9月26日 浏览:128次 评论:0
今天做系统的时候遇到一个问题,需要把session中的某个字符串打印出来。

我用的是<bean:write/>标签。刚开始在jsp页面输出了整字符串。

比如。session中

view plaincopy to clipboardprint?
String selectStr = "<select name='contract_type'><optgroup label='contract_name'><option value='contract_code'>contract_name</option></optgroup></select>";

String selectStr = "<select name='contract_type'><optgroup label='contract_name'><option value='contract_code'>contract_name</option></optgroup></select>";set 到session中

view plaincopy to clipboardprint?
request.getSession().setAttribute("select", selectStr);

request.getSession().setAttribute("select", selectStr);view plaincopy to clipboardprint?
在jsp页面

在jsp页面view plaincopy to clipboardprint?
<bean:write name="select" filter="false"/>

<bean:write name="select" filter="false"/>view plaincopy to clipboardprint?
说明:如果filter设置为true,属性中的所有特殊HTML字符都将被转化为相应的实体引用,即原样输出:

说明:如果filter设置为true,属性中的所有特殊HTML字符都将被转化为相应的实体引用,即原样输出:view plaincopy to clipboardprint?
<select name='contract_type'><optgroup label='contract_name'><option value='contract_code'>contract_name</option></optgroup></select>

<select name='contract_type'><optgroup label='contract_name'><option value='contract_code'>contract_name</option></optgroup></select>view plaincopy to clipboardprint?
;设置为false时,bean:write才会将来要打印的字符串中的特殊字符自动转换html的标签.<BR>

;设置为false时,bean:write才会将来要打印的字符串中的特殊字符自动转换html的标签.view plaincopy to clipboardprint?
标签:phpsession session
0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: