SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


Introduction to Java Servlet (Example Program) (Continue...)

 Introduction

Java Servlet is the one of the most important Java technologies. It is the simplest model to build a complete Java J2EE Web Application. Furthermore, even for complex J2EE Web Application that uses Struts, Spring, EJB and etc, they are still using Servlet for certain purposes such as Servlet Filter, Listener and etc. Thus, it is just a good idea for you to have well-built understanding of Java Servlet. Prior reading this tutorial, it would be excellent if you have mastered the basic Java programming languages.

Servelet Example is give below with complete steps with screen-shots

CLICK HERE to download this complete example (zip file)


 Package the Servlet into a J2EE Application (Continue...)

  1. Next goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Deploytool. CLICK HERE to see how to Start the Deploytool
    Now in the deploytool,
    1. Goto File ->New -> Application

      (Click the Browse button)


    2. (Select the folder in the Look In dropdown box, and then give a file name “EmployeeDetails”. Next click the New Application button)


    3. (Click the OK button)
    4. Now goto File -> Save to save the file
    5. Next, goto File -> New -> Web Component

      (Click Next button)


    6. (Enter the WAR Name as “EmpApp” and then click the Edit Contents… button)


    7. (Select all the .class, .jsp , .tld and .html files and click the Add button)


    8. (Now click the OK button)


    9. (Now click the Next button)


    10. (Now select the Servlet option button and then click the Next button)


    11. (Now select the “EmployeeDetails” from the Servlet Class dropdown box)


    12. (Now select the Next button)


    13. (Now select the Finish button)


    14. (Now select the EmpApp in the left pane and select the General tab in the right pane. Here give a name “emp_details” in the Context Root text box)
    15. Next select the EmployeeDetails in the left side

      (Now select the EmployeeDetails in the left pane and then select the Aliases tab in the right pane. Next select the Add button)


    16. (Now add a name as “EmployeeDetails”)

    17. Now goto File ->Save
    18. Next goto Tools -> Deployee

      (Enter the User Name as “admin” and Password as “password” (CLICK HERE for password). Next click the OK button)


    19. (Now a message --- Operation Completed Successfully --- must display. Next click the Close button)
    20. Next goto File -> Exit to close it


 Click Next To Continue ...
<- PREVIOUSNEXT ->