Tag: java servlet

Methods in javax.servlet.http.HttpServlet

As we discussed in the earlier articles, we should extend our servlet class with HttpServlet abstract class in order to get protocol dependent services. When ever we make request to the servlet the following methods will be called…

How to Retrieve Client Input Data in Servlet

When client send some input data to the servlet, that data will be available in the form of request object.  We can retrieve that input data through HttpServletRequest or ServletRequest interfaces.  There are 4 approaches to retrieve the client…

Example on getParameterNames() method of Servlet Request Object

So far we have worked on getParameter(), let us see how to use getParameterNames() method. With getParameter() we are able to find parameter values by passing parameter name, just like.. In html: <input type=”text” name=”n1″> In Java: String val=req.getParameter(“n1”);…

Example on getParameterMap() method of Servlet Request Object

Let us see about getParameterMap() method of servlet request object.  This method is little more useful compared to previous methods . Syntax Map m = request.getParameterMap() getParameterMap() method always returns Map object But how we will get input…

Example on getParameterValues() method of Servlet Request

The method getParameterValues() will generally came into picture if there is a chance of getting multiple values for any input parameter, this method will retrieve all of it values and store as string array. Syntax String values = getParameterValues(“Input…

Example of ServletConfig in Java Servlet

Let us see why/how to use ServletConfig interface in java servlet…. ServletConfig is one of the pre-defined interface. ServletConfig object is used for developing flexible servlets. ServletConfig objct exist one per servlet program. An object of ServletConfig created by…

Example of ServletContext in Java

ServletContext is one of pre-defined interface available in javax.servlet.*; Object of ServletContext interface is available one per web application. An object of ServletContext is automatically created by the container when the web application is deployed. Assume there exist a…

How to Connect Servlet to the Database with Example

Let us see how to connect servelet application with (Oracle) database, for time being i am considering Oracle XE.  In our application i am going to display all the records from the table ‘Java4s‘. Make sure you have java4s…

If you enjoyed this blog, please consider sharing it...!!!
Most Recent Posts from Top Categories
Spring Boot Hibernate Spring
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2025 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.