Java for the WWW November 2012Slide Tag Libraries What are they? –Custom libraries Custom tags – see examples in following slides.

Slides:



Advertisements
Similar presentations
JSP and web applications
Advertisements

Apache Tiles.
CS4273: Distributed System Technologies and Programming I Lecture 11: JavaServer Pages (JSP)
Java Server Pages Jeffrey Jongko. Introduction Java Server Pages (JSP) technology was created by Sun Microsystems and is built on top of Sun’s Java Servlet.
Apache Struts Technology
A Blackboard Building Block™ Crash Course for Web Developers
Cascading Style Sheets Understanding styles. The term cascading describe the capability of a local style to override a general style. CSS applies style.
Java II--Copyright © Tom Hunter. J2EE JSP Custom Tag Libraries.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
DT211/3 Internet Application Development
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
Generate Dynamic Content On Cache Server Master’s Project Proposal by Aparna Yeddula.
Executable XML Present by 吳昆澤. Outline  Introduction  Simkin  Jelly  o:XML  Conclusion.
DT228/3 Web Development JSP: Directives and Scripting elements.
Java/Web 2011 Revision Slide Exam Date/Location Check noticeboard outside Faculty Reception office,
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
JavaServer Pages TM Introduce by
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
OOSSE - OO Review Review session A review of other OO technologies and may be useful for exam (not required for assignment) OO web development philosophy.
1 CHAPTER 1 OVERVIEW of JDEVELOPER. 2 Overview of JDeveloper Oracle’s JDeveloper 10g (JDeveloper) is an integrated development environment for Java programming.
Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JSP models Assignment context “Register as a member of the site/show member details/update.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
® IBM Software Group © 2007 IBM Corporation JSP Custom Tags
 Embeds Java code  In HTML tags  When used well  Simple way to generate dynamic web-pages  When misused (complex embedded Java)  Terribly messy.
Stanisław Osiński, 2002JSP – A technology for serving dynamic web content Java Server Pages™ A technology for serving dynamic web content Stanisław Osiński,
Web Server Programming 3. Server side includes. HTML+ (‘hole’) technologies Uses ‘HTML+”, HTML (or XML) extended with code. Very many different varieties.
Fall 2007cs4201 Advanced Java Programming Umar Kalim Dept. of Communication Systems Engineering
Chapter 7 Using Custom Tag Libraries and the JSP Standard Tag Library.
JSP Tag Libraries Lec Last Lecture Example We incorporated JavaBeans in “Course Outline” Example But still have to write java code inside java.jsp.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
CS320 Web and Internet Programming Custom Tag Library Chengyu Sun California State University, Los Angeles.
JavaServer Page by Antonio Ko. Overview ► Introduction ► What is a servlet? ► What can servlets do? ► Servlets Vs JSP ► Syntax ► Samples ► JavaBean ►
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
JSP Custom Tags. Prerequisites Servlet API Mapping to JSP implicit objects JavaServer Pages Basic syntax Implementation via servlet API XML.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
JSP Pages. What and Why of JSP? JSP = Java code imbedded in HTML or XML –Static portion of the page is HTML –Dynamic portion is Java Easy way to develop.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Java WWW 2013 Revision Slide Exam Date/Location Check noticeboard outside School Reception office,
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
DT228/3 Web Development JSP: Actions elements and JSTL.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
® IBM Software Group © 2007 IBM Corporation JSP Tag Files
J2EE JSP Custom Tag Libraries 1 3 JSP: Custom Tag Libraries.
CS320 Web and Internet Programming Custom Tag Library Chengyu Sun California State University, Los Angeles.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Comparative Display Technologies in Sakai.
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
Introduction to JSP Liu Haibin 12/09/2018.
Knowledge Byte In this section, you will learn about:
Design and Maintenance of Web Applications in J2EE
MSIS 655 Advanced Business Applications Programming
Java Server Pages (JSP)
JavaServer Faces: The Fundamentals
Presentation transcript:

Java for the WWW November 2012Slide Tag Libraries What are they? –Custom libraries Custom tags – see examples in following slides –Standard Tag Library (JSTL) – recommend that you read the following: Purpose and benefits for JSP web development –Lot of development and includes the AJAX technology but this is outside the scope of this moduleAJAX technology For further reading on Tag libraries – here is nice tutorial to back up the following notes link

Java for the WWW March 2009Slide Custom tags Custom tags are dynamic page elements. This means they can provide functionality to a web page using a syntax similar to normal HTML tags. The functionality is up to you… They can provide an alternative (or an additional) mechanism to JavaBeans for dynamic scripting.

Java for the WWW March 2009Slide What do you need? There are two components to a tag: –A Java tag handler class that implements the tag’s functionality. –A Tag Library Descriptor (TLD) in the form of an XML file describing the tag. By including this tag on a JSP page you have access to its functionality.

Java for the WWW March 2009Slide Java handler class Yes, you have to code the functionality in Java. So why bother? Why not just create a JavaBean instead? –For standard web page scripters, tags are more familiar and provide a simpler mechanism. –For web application developers, JavaBeans integrate more fully with the full application environment so are more powerful. Your choice….

Java for the WWW March 2009Slide Making the handler You Java class needs to extend the TagSupport class. This class is only available in the Enterprise version of the Java Development Kit (from version 1.3.1). Or, the Java Web Services Developer Pack. However, you just need the lib/j2ee.jap file (in the case of J2EE) or the lib/servlet.jar for the JWSDP. You can then extract the javax.servlet.jsp.tagext class from the.jar file (using WinZip etc.) and put it into folder containing your tag classes – see screen grab on next powerpoint

Java for the WWW March 2009Slide

Java for the WWW March 2009Slide Making the handler Once you have your custom tag Java code, you need to compile it and put the resultant.class file in your WEB-INF/classes folder. For the examples, this would go in: –WEB-INF/classes/mytags

Java for the WWW March 2009Slide Example handler

Java for the WWW March 2009Slide Tag Library Descriptor A TLD is a (fairly) simple XML file that describes a set of custom tags. You can put as many or as few custom tags in a TLD and more than one TLD can be used in a single project. In principle, you could create many useful tags and zip them into one.jar file for easy re- usability.

Java for the WWW Slide Example Tag Descriptor

Java for the WWW March 2009Slide Using your custom tag To use your custom tag, you need a JSP page. You need to tell your JSP where to find your tag library so you use a page directive: Anywhere in your JSP page, you can then use your custom tag(s):

Java for the WWW March 2009Slide Example with a JSP

Java for the WWW March 2009Slide Running tag examples Hello tag example link Formatting example link Date tag example link Formatted Date example link

Java for the WWW March 2009Slide The use of tag libraries is all about... Re-usability Defining things once and making them available for use in more than one place Simplification Bespoke JSP work Or using existing tag libraries available for use - See the following Jsptags.com Jspin Jakata Apache Jakata Apache Taglibs project