package j2ee;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class ServletListenerSession extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html");
		PrintWriter pw = response.getWriter();
		HttpSession session = request.getSession();
		String str = (String) session.getAttribute("dog");
		String dogName = (String) session.getAttribute("name");
		pw.println("The breed of the dog is " + str);
		pw.println("The name of the dog is " + dogName);
		session.invalidate();
	}
}
