JSP Response.setAttibute()方法:设置指定名称的属性值

  • 内容
  • 评论
  • 相关

该方法用于设置指定名称的属性值,并将其保存在 session 对象中。

语法:

setAttribute(String name,Object value)

参数说明:

  • name:要设置的属性名称。
  • value:对应属性名称的属性值。

示例

向 session 对象中保存信息,关键代码如下:

<%
  session.setAttribute("information","向session中保存数据");
  response.sendRedirect("forward.jsp");
%>

本文标题:JSP Response.setAttibute()方法:设置指定名称的属性值

本文地址:http://www.hosteonscn.com/6330.html

评论

0条评论

发表评论

邮箱地址不会被公开。 必填项已用*标注