SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


JSP Custom Tags And Design Patterns - Project (Continue...)

 Introduction

A well-designed custom tag library will typically contain a focused set of interrelated tags that provide common or integrated functionality. For example, one library might contain a set of debugging tags for use during page development, while another might provide extensions to the standard JSP Bean tags for improved flow control.

CLICK HERE to download this complete example (zip file)


 Steps to Deploy and Run this Custom Tags and Design Patterns Project

  1. Write a html file and name it as AcceptInput.html
  2. Write a java file and name it as HelloTag.java
  3. Write a tld file and name it as Mytaglib.tld
  4. Write a jsp file and name it as Hello.jsp
  5. Set the path in the command prompt
    set path=.;D:\progra~1\java\j2sdk1.5.0\bin;D:\Sun\AppServer\bin;
    Set classpath=.;D:\progra~1\java\j2sdk1.5.0\lib;D:\Sun\AppServer\lib\j2ee.jar;
    (OR)
    Set the path in the system itself. CLICK HERE for details
  6. Now compile the HelloTag.java. CLICK HERE to see how to compile
    Note: It is important that this HelloTag.class file must be placed inside a folder hello
  7. After the java programs are compiled successfully, you can close the command prompt.
  8. Now goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Start Default Server (wait till it start and then press any key). CLICK HERE to see how to Start the Server
  9. 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 “JspCustomTagsAndDesign”. 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 “CusApp” and then click the Edit Contents… button)


    7. Note: It is important that HelloTag.class file must be inside the folder hello as shown in the figure
      (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 JSP Page option button and then click the Next button)


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


    12. (Now select the Next button)


    13. (Now select the Finish button)


    14. (Now select the CusApp in the left pane and select the General tab in the right pane. Here give a name “design_tag” in the Context Root text box)
    15. Now select the File Ref’s tab in the right side pane and then click the Add Tag Library button in the JSP Tag Libraries. Here in the URI column type /Mytaglib.tld and in the Location column type /web-inf/Mytaglib.tld
    16. Now goto File ->Save
    17. Next goto Tools -> Deployee

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


    18. (Now a message --- Operation Completed Successfully --- must display. Next click the Close button)
    19. Next goto File -> Exit to close it
  10. Now open an Internet Explorer and type the address http://localhost:8080/design_tag/AcceptInput.html
  11. Program completed Successfully
  12. To stop the server goto Start -> All Programs -> Sun Microsystems -> Application Server PE -> Stop Default Server. CLICK HERE to see how to Stop the Server

 Click for Next Topic
<- PREVIOUSNEXT ->