Java Reference
In-Depth Information
Notice that now we can see some additional information, the name and values
of the request parameters corresponding to the fields in the input JSP file, we can
also see the instance of
SurveyData
we stored as a request attribute when the
processRequest()
method of our servlet was executed.
The different tabs in the HTTP monitor allows us to examine different pieces of
information. The
Cookies
tab allows us to see any incoming or outgoing cookies.
Incoming cookies are cookies that were set
before
our code (JSP or servlet) executed.
Outgoing cookies are cookies that were set
while
our code executed. In the previous
screen shot, we can see that a cookie was automatically added by the application
server. This cookie is used to track the user session.
We can add our own cookies by invoking the
addCookie()
method
on the
response
object. This method takes an instance of
javax.
servlet.http.Cookie
as its sole parameter. Right after the code
invoking this method has executed, the cookie will be displayed as an
outgoing cookie; it will be displayed as an incoming cookie afterwards.
The
Session
tab indicates if the session was created as a result of the request, or if it
existed previously.