package com.ack.web.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class IncludeAServlet extends HttpServlet {
public void doGet( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException {
res.setContentType( "text/html" );
PrintWriter pw = res.getWriter();
pw.println( "The Including Servlet
" );
pw.println( "
request uri: " + req.getRequestURI() );
pw.println( "
servlet path: " + req.getServletPath() );
pw.println( "
path info: " + req.getPathInfo() );
pw.println( "
query string: " + req.getQueryString() );
pw.println( "
" );
RequestDispatcher rd
= getServletContext().
getRequestDispatcher( "/includeme/marvin/gaye?billy=idol" );
rd.include( req, res );
}
}