request.setAttribute()

Boa noite estou lendo o livro use a cabeça servlet e JSP porem me deparei surgiu uma duvida a respeito de um método.
request.setAttribute()

o que ele faz em especifico.
o Código Encostra-se na pagina 89

setAttribute

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

Documentação aqui.

1 curtida

Muito Obrigado raphaeloneves