faqts : Computers : Programming : Languages : Java : Servlet

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 12 people (25%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

Java: Servlet: Create: How to create a servlet?

Apr 16th, 2006 23:25
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 07 September 2003 - 01:30 am ------------------

Java: Servlet: Create: How to create a servlet?

Steps: Overview


 1. download and install the Java Server Development Kit from Sun
    and or install Tomcat:

 2. Create a servlet source code using your favorite text editor

    1. Inside the servlet put source code to generate a HTML page

 3. Compile and debug it

 4. Run it

---

Steps: Worked out:


 1. download and install the Java Server Development Kit from Sun
    or install Tomcat:

     http://www.faqts.com/knowledge_base/view.phtml/aid/14745/fid/426

 2. Create a servlet source code using your favorite texteditor

    1. Inside the servlet put source code to generate a HTML page

 3. Run and test it (e.g. using servletrunner.exe)

    -Call it by typing the URL in your favorite browser

      (e.g.

        http://localhost:8080\servlet\myservletcode?myparameters

     or inputting this URL as the ACTION in a FORM (using GET and POST)

    -When this URL reaches the Java complient Web server, it will
     pass this URL completely to the ServletRequest object
     in this servlet.

     The servlet has library routines to e.g. extract the parameters
     from this URL, which it can handle further.

 Step 4. Inside the servlet put source code to generate a HTML page

      e.g. -JDBC code to connect to a database

           -Create a HTML page, by printing the output of the database,
            which is stored in the ResultSet variables.

            This output is sent back via the ServletResponse object.

===

Internet: see also:

---

Language: Computer: Java: Servlet: Link: Overview: Can you give an 
overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/40576/fid/778

----------------------------------------------------------------------