Monthly Archives: February 2016

servlet doGet /doPost

there is a method to get the launch the doGet method servlet when we start the server on eclipse or when we access the server.
there is a JSP page which is in charge to display all the details given by a database.
we must load the database before launching the JSP and displaying the date.

all the magic happen in the web.xml configuration file :



<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns:xsi=”” xmlns=”” xsi:schemaLocation=”” version=”3.0″>

Please enter a temperature to convert.




we have to get the serlvet name Driver and the access to the Main class called Driver as well.
there is a server mapping which is going to map the url assignment1 to the servlet name.

then there is the welcome file before it was my main JSP page called index.jsp so the server were launching this page by default then skipping the doGet method which load the DB(this need to be fixed later to implement this inside the init method of the servlet.
here we choose to provide the url-pattern called assignment1 which is going to launch the servelet main class and the doGet by default.

This is a remionder for me in case i need this later.