Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Servlet Example in Java:-



Servlet is the special class in java which provide set of web method to write server side java program.

Servlet class is used to implement dynamic functionality under JAVA Web application.

Servlet is also called Server Side Java Class .

Java provide HttpServlet class to implement Servlet Functionality.

Servlet class will run under web server or application server.

means we should install Apache Web Server or Glassfish Web Server to execute Servlet Class

class Classname extends HtttpServlet
{
     public void doPost(HttpServletRequest request,HttpServletResponse response)
     {

      }
      public void doGet(HttpServletRequest request,HttpServletResponse response)
     {


      }
   


}


How We create Servlet Class Practically:-

File ----> New Project---> JAVA WEB---->  Web Application


In Netbeans 

Right click on  Source Package ----> Servlet------>

Note;-  We should always write code under servlet ,design will be represented by JSP Web page.









Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post