Java Reference
In-Depth Information
Fig. 8.10 A page to accept the user's preferences for storing in cookies
Here is the code for the ShowSum servlet:
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.WebServlet;
public class ShowSum extends HttpServlet
public void service(HttpServletRequest request,
HttpServletResponse response)
throws IOException,ServletException
HttpSession adderSession = request.getSession();
String fi rstTime =
(String)adderSession.getValue("fi rstVisit");
if (fi rstTime.equals("Yes"))
Search WWH ::

Custom Search