philihp.com

Tag: Servlet

Servlet Filters mapped to JSPs in Tomcat

Servlet filters were introduced in the Servlet 2.3 spec a long time ago. They’re basically classes that you can add to any Java webapp that intercept every request and can do anything you can imagine (e.g., compress output, translate, handle authentication, the only limit is yourself). They’re added into the web.xml file where every webapp starts, [...]

Sending HTTP Requests without Reloading and without AJAX

Supposing I have a simple HTML form that looks like this: <form method=”post” action=”/SomeServlet”> <input type=”text” name=”message” value=”Hello Server” /> <input type=”submit” value=”Send” /> </form> And supposing I have a Servlet mapped at the path /SomeServlet, consisting of the code: public class SomeServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException [...]