ServletRequest InterfaceAn object of ServletRequest is used to provide the client request information to a servlet such as content type, content length, parameter names and values, header informations, attributes etc. Methods of ServletRequest interfaceThere are many methods defined in the ServletRequest interface. Some of them are as follows:
Example of ServletRequest to display the name of the userIn this example, we are displaying the name of the user in the servlet. For this purpose, we have used the getParameter method that returns the value for the given request parameter name. index.html DemoServ.java download this example (developed without IDE) download this example (developed using Eclipse IDE) download this example (developed using Netbeans IDE) Other examples of ServletRequest interfaceExample of ServletRequest to display all the header informationIn this example, we are displaying the header information of the servlet such as content type, content length, user agent etc. Next TopicRequestDispatcher in Servlet |