0 O O N N     N o                  counterNameLjava/lang/String; ConstantValuedefaultInitialValueI  initialValue()VCodeLineNumberTableLocalVariableTablethis LCounter;init (Ljavax/servlet/ServletConfig;)Ve!Ljava/lang/NumberFormatException;confLjavax/servlet/ServletConfig;s ExceptionsdoGetR(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Vitempreq'Ljavax/servlet/http/HttpServletRequest;res(Ljavax/servlet/http/HttpServletResponse;countercookies[Ljavax/servlet/http/Cookie;cLjavax/servlet/http/Cookie; hadCookiesZ hadCounterbytesLjava/io/ByteArrayOutputStream;outLjava/io/PrintStream;getServletInfo()Ljava/lang/String; SourceFile Counter.java WX ^_initial VT java/lang/NumberFormatExceptionjava/lang/StringBuffer0** Non-numeric format for 'initial' parameter: }  } javax/servlet/http/Cookie } W$Supports Cookie Counter Demo Servlet  java/io/ByteArrayOutputStream Wjava/io/PrintStream W Cookie Counter(

Cookie Counter


&

Your session's counter was ' before you visited this page.%

The counter has been incremented.

+

You presented no session cookie. A new+cookie was created, with an initial counterholding the value .%

You presented these cookies:

    
  1. Name =  , Value = } , Domain = } , Path = 
0

Watch the value of the counter change as you0reload this page! The counter is updated by the2servlet which dynamically generates this web page.2

Try comparing how different browsers work with2cookies set using these two URLs on this server: ,/counter.html, and./servlet/Counter.1These URLs refer to different 'counter' servlets,2which initialize their counts to different values. User-Agent 

Your browser is  not known!. X text/html /Demonstrates the 'Cookie' API for user sessionsCounterjavax/servlet/http/HttpServletjavax/servlet/ServletExceptionjava/io/IOExceptiongetInitParameter&(Ljava/lang/String;)Ljava/lang/String;java/lang/IntegerparseInt(Ljava/lang/String;)Iappend,(Ljava/lang/String;)Ljava/lang/StringBuffer;toStringlog(Ljava/lang/String;)V%javax/servlet/http/HttpServletRequest getCookies()[Ljavax/servlet/http/Cookie;getNamejava/lang/Stringequals(Ljava/lang/Object;)Zclone()Ljava/lang/Object;getValue(I)Ljava/lang/String;setValue'(Ljava/lang/String;Ljava/lang/String;)V setComment&javax/servlet/http/HttpServletResponse addCookie(Ljavax/servlet/http/Cookie;)V(I)V(Ljava/io/OutputStream;)Vprintln(I)Ljava/lang/StringBuffer; getDomaingetPath getHeaderflushsetContentTypesize()IsetContentLengthgetOutputStream%()Ljavax/servlet/ServletOutputStream;writeTo!NOPQRSTRUVTWXY/*Z/[ \]^_YC*+*YM * ,*,!N* *Y  , !$Z& RTUX!\$Y%Z+[B^[*%`aC\]Cbc 6dQefghY K*>:66+Y:V66H222:>`6: : Y:,Y:Y:    !  "  # / $  %  & '  (  ) . *  +  Y , -.  / 6  u 0   2  1   2  22Y:  3   22  24Y:  5   24  6  7  8  9  :  ;  <  =  >  ? +@A:  Y B   C D  E  F,GH,IJ,KL8\_ZDijkrsu(v8|E}N~Y\_adgumr$+6=JQ^ls ',4?!J"[a`a MiTi9jQ .ziT K\]KklKmnFoT4pqCrs @tu=vuwxyz SjQ ef{|}Y-MZ)[ \]~