Posts

Showing posts from August, 2020

Steps to Create First Servlet

 This blog will help you to create demo servlet program and also explain the steps to create it. Step 1: First create one HTML File and add following code   <html> <head> <title>Introductions</title> </head> <body>     <form action="FirstServlet" method="GET">     If you don't mind me asking, what is your name? <input name="name" type="TEXT" /><p> <input type="SUBMIT" /> </p></form> </body> </html>   Step 2: Now create one servlet file as FirstServlet and add following code import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class FirstServlet extends HttpServlet {   public void doGet(HttpServletRequest req, HttpServletResponse res)                                throws ServletExceptio...

Create Servlet with doPost method.

  This blog will demonstrate with dopost method in Servlet      Step 1: F irst create one html file and add following code in it.   <html> <body> <form action="HelloFormPost" method="POST"> First Name: <input name="first_name" type="text" /> <br /> Last Name: <input name="last_name" type="text" /> <input checked="checked" name="maths" type="checkbox" /> Maths <input name="physics" type="checkbox" /> Physics <input checked="checked" name="chemistry" type="checkbox" />                                                 Chemistry <input type="submit" value="Select Subject" /> </form> </body> </html> Step 2: Now create one servlet file as  HelloFormPos...

Configure Servlet in NetBeans. Steps to Create First Servlet.

Image
  This blog will help you to create your first servlet program and also explain the steps to create it. Step 1: F irst we required a server on which we can run our servlet application. One can install Glassfish server or Apache Tomcat Server. To Add New Server follow these steps. 1. Go to services ->Right Click ->Add Server 2.  Choose a Server which you wan to install   3. Click Download Now     Step 2:    Go to you project -> New Project->Java Web->Web Application   Now give the name of project.   Now select the Server which you have installed on which we can run our first servlet application   Now Click->Next and then Finish Now you can see your newly created project folder     Step 3: Now we will create a new program file. Go to WebPages->RightClick->New->HTML  Now give file name as first Step 4: Now add following code in the First.html file    Now go to SourcePackage->Ri...