Servlets Section Index
What features are in Servlet 3.0?
Servlet 3.0 makes key changes from Servlet 2.5 to deliver greater simplicity and ease of development.
How can I avoid making multiple HTTP calls for content that hasn't changed? Is it possible to cache it? Is there a way to set this in the header?
This can be achieved by using a filter. You can setup the filter in your web.xml to intercept the response and edit the HTTP headers for the specified content type. An example filter...more
What is the difference between RequestDispatcher's forward(ServletRequest request, ServletResponse response) method and HttpServletResponse's sendRedirect(String location) method?
What is the difference between RequestDispatcher's forward(ServletRequest request, ServletResponse response) method and HttpServletResponse's sendRedirect(String location) method?
What is the difference between request.getParameter() and request.getAttribute() ?
What is the difference between request.getParameter() and request.getAttribute() ?
How can I give a bean application scope from a servlet like you can from JSP by doing <jsp:useBean id="bean" scope="application" /> ?
How can I give a bean application scope from a servlet like you can from JSP by doing <jsp:useBean id="bean" scope="application" /> ?
How can I serve Word/Excel documents to a web client from JSP's and/or servlets?
How can I serve Word/Excel documents to a web client from JSP's and/or servlets?
Why do we need a constructor in a servlet if we use the init method?
Why do we need a constructor in a servlet if we use the init method?
What is GlassFish?
The GlassFish Project is Sun's open source application server project. Found at https://glassfish.dev.java.net/, you can participate in the development of the latest version of Sun's Java System A...more
Cross Site Scripting (XSS) with Jakarta Tomcat.
Hi,
The XSS vulnerability has been found at the time Tomcat 4.0.3 has been released (and 4.1.2 was in beta). The problem was connected to the fact that it was possible to run some specific classes...more
Tomcat 4.x and servlet mapping.
Tomcat 4.x and /servlet/ mapping.
What's difference between Servlet/JSP session and EJB session?
From a logical point of view, a Servlet/JSP session is similar to an EJB session. Using a session, in fact, a client can connect to a server and maintain his state.
But, is important to understan...more
Does anyone know if there is a way to check the size of a file (a picture in my case) that the user can upload from a form *BEFORE* the file is uploaded?
Does anyone know if there is a way to check the size of a file (a picture in my case) that the user can upload from a form *BEFORE* the file is uploaded?
I have a Servlet and a Servlet Filter that is supposed to apply an xsl to it. The transformation appears to work, I get back a transformed document, but it appears (in IE) as if IE thinks its an HTML document. Viewing source, and saving as an HTML file will display correctly. How can I correctly set the Content Type of the response?
I have a Servlet and a Servlet Filter that is supposed to apply an xsl to it. The transformation appears to work, I get back a transformed document, but it appears (in IE) as if IE thinks its an HT...more
I want to exclude a certain file, "*/SlideMenu.js", from a filter. Can I do it?
I want to exclude a certain file, "*/SlideMenu.js", from a filter. Can I do it?
How do I execute a servlet from the command line, or from Unix shell program or Windows BAT file?
Of course as with any Java class, you could put a "main" method in your class that extends HttpServlet, so you could run it (the main(), not the doGet/doPut/service()) from a command line.
But i...more