|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--examples.servlets.CookieCounter
This servlet example demonstrates how to create and retrieve a cookie and how to set a maximum age on a cookie.
The servlet displays how many times it has been visited by all clients since the server was started, and also displays how many times each client has visited in the 10 seconds that have passed since the last visit.
prompt> ant CookieCounter
http://localhost:7001/examplesWebApp/CookieCounter
On HP platforms, the cookie may not expire after 10 seconds.
| Constructor Summary | |
CookieCounter()
|
|
| Method Summary | |
void |
init(javax.servlet.ServletConfig config)
Initializes the servlet. |
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Implements the service method of the servlet. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CookieCounter()
| Method Detail |
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in class javax.servlet.GenericServlet
public void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException
service in class javax.servlet.http.HttpServlet
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||