import javax.servlet.*;
import javax.servlet.http.*;
public class UselessServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException {
doService(req, res);
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException {
doService(req, res);
public void doService(HttpServletRequest req, HttpServletResponse
throws ServletException {
// Service GET or POST here
Figure 66. Implementing doGet and doPost with doService
Parameters are passed to the servlet in the HttpServletRequest object. The
getParameter method of the HttpServletRequest class is used to obtain these
parameters. For example, if our servlet UselessServlet is accessed with a
GET request of the following manner:
we can obtain the parameter value for password using the following code:
String password=req.getParameter( password );
Although the parameter is not showed in the URL, the POST method also
retrieve these parameters using the HttpServletRequest object. Therefore,
the same code can be for both the GET and POST method.
Table 5 shows the list of servlets that we use and the environment that they
run on.
Table 5. Servlet list
Servlet name
Test DB2 connection
Test Domino connection
Linux Web Hosting with WebSphere, DB2, and Domino



About Services Network Support FAQ Order Contact

Linux Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting  Business web hosting division of Vision Web Hosting Inc. All rights reserved