blob: 3e8d25b479b36a0f9788d4a6632d6ae5550c9086 [file] [log] [blame]
Vinay Vishal57171472018-09-18 20:22:00 +05301/*
2 * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v. 2.0, which is available at
6 * http://www.eclipse.org/legal/epl-2.0.
7 *
8 * This Source Code may also be made available under the following Secondary
9 * Licenses when the conditions for such availability set forth in the
10 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 * version 2 with the GNU Classpath Exception, which is available at
12 * https://www.gnu.org/software/classpath/license.html.
13 *
14 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 */
16
17package test;
18
19import java.io.*;
20import java.net.*;
21import java.util.*;
Gaurav Guptaeea72b52020-05-05 18:13:58 +053022import jakarta.servlet.*;
23import jakarta.servlet.http.*;
Vinay Vishal57171472018-09-18 20:22:00 +053024import org.xml.sax.InputSource;
25import org.w3c.dom.Element;
26import org.w3c.dom.Document;
27import org.w3c.dom.NodeList;
28import org.w3c.dom.Node;
29
30import org.xml.sax.SAXException;
31import org.xml.sax.SAXParseException;
32import org.xml.sax.SAXException;
33
34// jaxp 1.0.1 imports
35import javax.xml.parsers.DocumentBuilderFactory;
36import javax.xml.parsers.DocumentBuilder;
37
38import java.net.URL;
39import java.util.ArrayList;
40import java.util.HashMap;
41
42import javax.naming.*;
43import javax.sql.*;
44import java.sql.*;
45
46public class ServletTest3 extends HttpServlet{
47
48 private ServletContext context;
49
50 public void init(ServletConfig config) throws ServletException {
51 super.init(config);
52 System.out.println("[Servlet3.init]");
53 context = config.getServletContext();
54 }
55
56 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
57 System.out.println("[Servlet3.doGet]");
58 doPost(request, response);
59 }
60
61 public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
62 System.out.println("[Servlet3.doPost]");
63
64 response.setContentType("text/html");
65 PrintWriter out = response.getWriter();
66
67 out.println("FILTER-REQUEST:" + request.getSession().getAttribute("FILTER-REQUEST"));
68 out.println("FILTER-FORWARD:" + request.getSession().getAttribute("FILTER-FORWARD"));
69 out.println("FILTER-INCLUDE:" + request.getSession().getAttribute("FILTER"));
70 }
71
72}
73
74
75