jsp的内置对象request

在开发jsp时,有的变量不需要预先声明就可以在脚本代码和表达式中随意使用

如:request (HttpServletRequest类型)

handler.process(request);

实际开放中用到的方法API说明:

setAttribute (Methods inherited from interface javax.servlet.ServletRequest

public void setAttribute(java.lang.String name,
                         java.lang.Object o)
Stores an attribute in this request. Attributes are reset between requests. This method is most often used in conjunction with RequestDispatcher.
Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems. 
If the object passed in is null, the effect is the same as calling removeAttribute(java.lang.String). 
It is warned that when the request is dispatched from the servlet resides in a different web application by RequestDispatcher, the object set by this method may not be correctly retrieved in the caller servlet.


Parameters:
name - a String specifying the name of the attribute
o - the Object to be stored


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值