Forgot your
password?
HOME
FAQS
FORUMS
DOWNLOADS
ARTICLES
PEERSCOPE
LEARN
Search
View:
What's New
Index by Topic
Contributors
Topic List
Printable View
Unanswered Questions
Suggested Path
Servlets FAQ Home Page
FAQ Manager is guru
Sandip Chitale
PREMIUM
.
Answers to common questions about Java Servlet technologies, including Apache JServ, JRun, JSP, and so much more
What's New
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?
Java:API:Servlets:Performance
,
Java:API:JSP:Performance
Byron Tymvios
, Aug 31, 2006
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...
What is the difference between RequestDispatcher's forward(ServletRequest request, ServletResponse response) method and HttpServletResponse's sendRedirect(String location) method?
Java:API:Servlets
,
Java:API:JSP
Byron Tymvios
, Aug 31, 2006
The forward method of RequestDispatcher will forward the ServletRequest and ServletResponse that it is passed to the path that was specified in getR...
What is the difference between request.getParameter() and request.getAttribute() ?
Java:API:Servlets
,
Java:API:JSP
Byron Tymvios
, Aug 3, 2006
Ok, getParameter() first: Code: <html> <body> <form name="testForm" method="post" action="testJSP.jsp"> <input type="text"...
How can I give a bean application scope from a servlet like you can from JSP by doing <jsp:useBean id="bean" scope="application" /> ?
Java:API:Servlets
Byron Tymvios
, Jul 31, 2006
In a servlet you would need to manually create your bean object and then use the ServletContext's setAttribute method to give it application scope:...
Why do we need a constructor in a servlet if we use the init method?
Java:API:Servlets:Architecture and Design
Byron Tymvios
, Jul 31, 2006
Even though there is an init method in a servlet which gets called to initialise it, a constructor is still required to instantiate the servlet. Even...
How can I serve Word/Excel documents to a web client from JSP's and/or servlets?
Java:API:Servlets
,
Java:API:JSP
Byron Tymvios
, Jul 31, 2006
This can be done by specifying the content type of the response, in servlets you use response.setContentType("mime/type"); and in jsp you use the directive...
What is GlassFish?
Java:API:Servlets
,
Java:API:EJB
,
Java:API:JavaMail
John Zukowski
PREMIUM
, Jul 29, 2005
The GlassFish Project is Sun's open source application server project. Found at https://glassfish.dev.java.net/, you can participate in the development...
Cross Site Scripting (XSS) with Jakarta Tomcat.
Java:API:Servlets:Products:Tomcat
,
Tools:AppServer:WebServer:Tomcat:Security
,
Tools:AppServer:WebServer:Tomcat:Bugs
,
Tools:AppServer:WebServer:Tomcat:Configuration
Alessandro A. Garbagnati
PREMIUM
, Jul 31, 2003
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...
Tomcat 4.x and /servlet/ mapping.
Java:API:Servlets:Products:Tomcat
,
Tools:AppServer:WebServer:Tomcat:Versions
,
Tools:AppServer:WebServer:Tomcat:Configuration
Alessandro A. Garbagnati
PREMIUM
, Jul 31, 2003
With Tomcat 3.x, by default the servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory. A...
What's difference between Servlet/JSP session and EJB session?
Java:API:EJB:SessionBean
,
Java:API:Servlets:Cookies, Sessions, and State Management
Alessandro A. Garbagnati
PREMIUM
, May 7, 2003
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...
I want to exclude a certain file, "*/SlideMenu.js", from a filter. Can I do it?
Java:API:Servlets
Eelco Cramer
PREMIUM
, Apr 8, 2003
<filter-mapping> <filter-name>GZIPFilter</filter-name> <url-pattern>*.jsp</url-pattern> <...
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...
Java:API:Servlets
,
Languages:Markup:XML:XSL
Vincent Fischer
, Apr 8, 2003
I figured this out. Many thanks go out to Matan Amir for pointing me in the right direction. I used Ethereal (I couldn't get tcptrace to work), to verify...
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?
Java:API:Servlets:Images
Matan Amir
, Apr 8, 2003
I know that it is possible to check the size of the file on the server side once it has been completly uploaded by the user, but this is not ideal (e.g....
How can we find out the number of ServletContext currently active in a servlet container?
Java:API:Servlets
Alessandro A. Garbagnati
PREMIUM
, Mar 6, 2003
Hi, No, there are no references in the specifications for that. As far as I know there is nothing available for that, especially if you need something...
How do you create a browser cookie that persists to a different domain?
Java:API:Servlets:Cookies, Sessions, and State Management:Cookies
Jeff Hubbach
, Mar 6, 2003
I have server1 and server2(12.23.34.45). Note: I have no control over server2 and it's a cgi server. Server1 creates a request to server2. In response,...
How do I execute a servlet from the command line, or from Unix shell program or Windows BAT file?
Java:API:Servlets
Christopher Koenigsberg
PREMIUM
, Mar 6, 2003
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...
From a servlet, how do I access files and directories on the client's file system?
Java:API:Servlets:Files
Erik Runia
PREMIUM
, Jan 12, 2003
You cannot access the client's directory structure using a web application (jsp, servlet, javascript, html) because of security issues. You may need to...
How can I read parameters from a multipart/form-data upload form?
Java:API:Servlets:Files:Uploading
Sean Sullivan
, Jan 12, 2003
[That is, given the form: <FORM ACTION="/servlet/FooServlet" ENCTYPE="multipart/form-data" METHOD=POST> What is your name? <INPUT...
How should I configure JBuilder7 to work on servlets?
Java:API:Servlets:Products
Alessandro A. Garbagnati
PREMIUM
, Jan 12, 2003
JBuilder doesn't really need of any additional setup for working with Servlets. Just create a new Project and creare a new Web Application. Then when...
What is the role of the controller in MVC architecture?
Java:API:Servlets:Architecture and Design
Lasse Koskela
PREMIUM
, Jan 11, 2003
The role of controller is to dictate what to do behind the scenes and what to display in the view next. 1. Controller receives a request 2. Controller...
« previous
beginning
next »
Related Links
Servlets Forum
Servlet-related resource list from Purple Technology
jGuru JSP FAQ
Sun Servlet Home Page
Wish List
Features
About jGuru
Contact Us