Home » servlet » Page 3

Tag Archives: servlet

Java Servlet RequestDispatcher Tutorial

Communication between the Servlets is an important task to the programmer. Request Dispatcher is an interface whose implementation defines an object which can dispatch the request to any resources on the server. In this tutorial, we will see how the javax.servlet.RequestDispatcher interface is used to forward or include the response of a resource in a Servlet.         ...

Read More »

Java Servlet Application for Login Page

Servlets are modules of the Java code that run in a server application to answer the client requests. They are not tied to a specific client-server protocol but are most commonly used with HTTP. The word “Servlet” is often used in the meaning of “HTTP Servlet“. In this tutorial, we will explain how to handle the Servlet HTTP POST Request ...

Read More »

Java Servlet Url Parameters Example

Servlets are modules of the Java code that run in a server application to answer the client requests. They are not tied to a specific client-server protocol but are most commonly used with HTTP. The word “Servlet” is often used in the meaning of “HTTP Servlet” . In this tutorial, we will explain how to handle parameters of the Servlet ...

Read More »

Jetty Servlet Example

In this example, we will show you how to make use of Jetty – Java HTTP Web Server and servlet container and run a sample servlet on this server. Jetty is an open source web server developed by Eclipse Foundation. As a part of this example we will create an eclipse project which will have our servlet code and to ...

Read More »

Jetty Tutorial for Beginners

In this article, we will give brief information about Jetty and provide examples of   Java application deployment on Jetty. Our examples will consist of both standalone and Embedded modes of Jetty. Jetty is a Servlet container and  Web Server which is known to be  portable, lightweight, robust, flexible, extensible and easy to integrate. Jetty can be deployed as a standalone server ...

Read More »

Get client’s address and hostname in Servlet

In this example we are going to see how to get client’s address and hostname in a Servlet. Java offers a very convenient way to handle client and server information such as hostname ip address etc. Getting a client’s address and hostname requires that you: Get clients ip adfress using HttpServletRequest.getRemoteAddr(). Get clients hostname using HttpServletRequest.getRemoteHost().         ...

Read More »

Get all Init Parameters in Servlet

With tutorial we shall show you how to get all Init Parameters in Servlet. Using init parameters you can specify servelar inportant aspects of your servlets that are going to be handled during requests service. In order to do that you should: Create public void init() function on your servlet. Call getServletConfig().getInitParameterNames() Use put(initParamName, initParamValue) to put parameters in your ...

Read More »

Get/Set init Parameters in Servlet

In this example we are going to see how to get/set init parameters in a Servelt. Using init parameters you can specify several important aspects of your servlets that are going to be handled during requests service. In short, to get/set init Parameters in Servlet you should: Create public void init() function on your servlet. Call getServletConfig().getInitParameterNames() Use put(initParamName, initParamValue) ...

Read More »

Get all Request Parameters in Servlet

With this tutorial we shall show you how to get all requests parameters in a Java Servlet. This the most basic step you have to consider when developing a Servelt application because HTTP is based mostly on parameters exchange. Basically in order to get all Request Parameters in Servlet, one should take the following steps: Create a handleRequest method so ...

Read More »

Get Request Parameter in Servlet

With this tutorial we shall show you how to get request parameter in a Java Servlet. This the most basic step you have to consider when developing a Servelt application because HTTP is based mostly on parameters exchange. You will find this example particularly useful when you want to get the value of known parameter. Basically in order to get ...

Read More »