-
-
How to communicate between two servlets?
ANS: Two ways:1. Forward or redirect from one Servlet to another.2. Load the Servlet from ServletContext and access methods.
-
-
-
-
-
-
-
-
-
-
In servlets, what is the use of sendredirect(),include( ), forward() ?and in applecation level at what scnario they will be used
I know only that send redircet is of client side. and remaing are severside functions
-
-
Which code line must be set before any of the lines that use the PrintWriter?
setContentType() method must be set before transmitting the actual document.
-
-
-
What is a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization?
Although the SingleThreadModel technique is easy to use, and works well for low volume sites, it does not scale well. If you anticipate your users to increase in the future, you may be better off implementing explicit synchronization for your shared data. The key however, is to effectively minimize the amount of code that is synchronzied so that you take maximum advantage of multithreading.Also, note...
-
What information that the ServletRequest interface allows the servlet access to?
Information such as the names of the parameters passed in by the client, the protocol (scheme) being used by the client, and the names of the remote host that made the request and the server that received it. The input stream, ServletInputStream.Servlets use the input stream to get data from clients that use application protocols such as the HTTP POST and PUT methods.
Servlets Interview Questions
Ans