Skip to content

Instantly share code, notes, and snippets.

@mraad
Created September 21, 2013 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mraad/6651405 to your computer and use it in GitHub Desktop.
Save mraad/6651405 to your computer and use it in GitHub Desktop.
Log Web Servlet
@WebServlet(urlPatterns = "/log/*", loadOnStartup = 1)
public class LogServlet extends HttpServlet
{
@Override
protected void doGet(
final HttpServletRequest req,
final HttpServletResponse res) throws ServletException, IOException
{
/**
* Do some logic here to handle web requests
*/
req.setAttribute("qs", req.getQueryString());
req.getRequestDispatcher("/index.jsp").forward(req, res);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment