JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.

Slides:



Advertisements
Similar presentations
9 Copyright © 2005, Oracle. All rights reserved. Modularizing JavaServer Pages Development with Tags.
Advertisements

Java Script Session1 INTRODUCTION.
Apache Struts Technology
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
JavaScript Forms Form Validation Cookies CGI Programs.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
DT211/3 Internet Application Development
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
JSP Standard Tag Library
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
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.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
Java Server Pages Lecture July Java Server Pages Java Server Pages (JSPs) provide a way to separate the generation of dynamic content (java)
CSCI 6962: Server-side Design and Programming Java Server Faces Components and Tags.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Chapter 8 Cookies And Security JavaScript, Third Edition.
JSTL JSP Standard Tag Library 12-Oct-15. W HAT IS JSTL? JSTL (JSP Standard Tag Libraries) is a collection of JSP custom tags developed by Java Community.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
ASP.NET Programming with C# and SQL Server First Edition Chapter 5 Manipulating Strings with C#
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
Using Client-Side Scripts to Enhance Web Applications 1.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
JSTL: The JavaServer Pages Standard Tag Library Mark A. Kolb Security Broadband, Austin, TX
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
CS320 Web and Internet Programming Java Beans and Expression Language (EL) Chengyu Sun California State University, Los Angeles.
JSP Tag Libraries Lec Last Lecture Example We incorporated JavaBeans in “Course Outline” Example But still have to write java code inside java.jsp.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
JSTL The JavaServer Pages Standard Tag Library (JSTL) is a collection of useful JSP tags which encapsulates core functionality common to many JSP applications.
DT228/3 Web Development Databases. Querying a database: Partial info Search engines, on-line catalogues often need to allow user to search a database.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
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.
 Packages:  Scrapy, Beautiful Soup  Scrapy  Website  
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Chapter 14 Using JavaBeans Components in JSP Documents.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Lecture Transforming Data: Using Apache Xalan to apply XSLT transformations Marc Dumontier Blueprint Initiative Samuel Lunenfeld Research Institute.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
CS520 Web Programming Spring – Web MVC 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 
Web browser Web server HTML request Scripted pagedatabase The following components will be used: Apache Jakarta Tomcat servlet engine Derby JavaServer.
JSP: Actions elements and JSTL
Tutorial 10 Programming with JavaScript
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.
JDBC.
PHP Training at GoLogica in Bangalore
Knowledge Byte In this section, you will learn about:
JSP Standard Tag Library
Presentation transcript:

JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition

JSP - JavaBeans A JavaBean is a specially constructed Java class written in the Java and coded according to the JavaBeans API specifications. It provides a default, no-argument constructor. It should be serializable and implement the Serializable interface. It may have a number of properties which can be read or written. It may have a number of "getter" and "setter" methods for the properties.

JavaBeans Properties: A JavaBean property is a named attribute that can be accessed by the user of the object. The attribute can be of any Java data type, including classes that you define. A JavaBean property may be read, write, read only, or write only. JavaBean properties are accessed through two methods in the JavaBean's implementation class:

JavaBeans properties A read-only attribute will have only a getPropertyName() method, and a write-only attribute will have only a setPropertyName() method. MethodDescription getPropertyName()For example, if property name is firstName, your method name would be getFirstName() to read that property. This method is called accessor. setPropertyName()For example, if property name is firstName, your method name would be setFirstName() to write that property. This method is called mutator.

JavaBeans Example: index.jsp

UserBean.java class

LoginCheck.jsp file

JSP - Standard Tag Library (JSTL) The JavaServer Pages Standard Tag Library (JSTL) is a collection of useful JSP tags which encapsulates core functionality common to many JSP applications. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework for integrating existing custom tags with JSTL tags.

Classification The JSTL tags can be classified, according to their functions, into following JSTL tag library groups that can be used when creating a JSP page: Core Tags Formatting tags SQL tags XML tags JSTL Functions

Core Tags: The core group of tags are the most frequently used JSTL tags. Following is the syntax to include JSTL Core library in your JSP:

Core Tags: TagDescription Like, but for expressions. Sets the result of an expression evaluation in a 'scope' Removes a scoped variable (from a particular scope, if specified). Catches any Throwable that occurs in its body and optionally exposes it. Simple conditional tag which evalutes its body if the supplied condition is true. Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by and Subtag of that includes its body if its condition evalutes to 'true'. Subtag of that follows tags and runs only if all of the prior conditions evaluated to 'false'. Retrieves an absolute or relative URL and exposes its contents to either the page, a String in 'var', or a Reader in 'varReader'. The basic iteration tag, accepting many different collection types and supporting subsetting and other functionality. Iterates over tokens, separated by the supplied delimeters. Adds a parameter to a containing 'import' tag's URL. Redirects to a new URL. Creates a URL with optional query parameters

Formatting tags: The JSTL formatting tags are used to format and display text, the date, the time, and numbers for internationalized Web sites. Following is the syntax to include Formatting library in your JSP:

Formatting tags: TagDescription <fmt:formatNumber > To render numerical value with specific precision or format. Parses the string representation of a number, currency, or percentage. Formats a date and/or time using the supplied styles and pattern Parses the string representation of a date and/or time Loads a resource bundle to be used by its tag body. Stores the given locale in the locale configuration variable. Loads a resource bundle and stores it in the named scoped variable or the bundle configuration variable. Specifies the time zone for any time formatting or parsing actions nested in its body. Stores the given time zone in the time zone configuration variable To display an internationalized message. Sets the request character encoding

SQL tags: The JSTL SQL tag library provides tags for interacting with relational databases (RDBMSs) such as Oracle, mySQL, or Microsoft SQL Server. Following is the syntax to include JSTL SQL library in your JSP:

SQL tags: TagDescription Creates a simple DataSource suitable only for prototyping Executes the SQL query defined in its body or through the sql attribute. Executes the SQL update defined in its body or through the sql attribute. Sets a parameter in an SQL statement to the specified value. Sets a parameter in an SQL statement to the specified java.util.Date value. Provides nested database action elements with a shared Connection, set up to execute all statements as one transaction.

JSTL Functions: JSTL includes a number of standard functions, most of which are common string manipulation functions. Following is the syntax to include JSTL Functions library in your JSP:

JSTL Functions: FunctionDescription fn:contains()Tests if an input string contains the specified substring. fn:containsIgnoreCase()Tests if an input string contains the specified substring in a case insensitive way. fn:endsWith()Tests if an input string ends with the specified suffix. fn:escapeXml()Escapes characters that could be interpreted as XML markup. fn:indexOf()Returns the index withing a string of the first occurrence of a specified substring. fn:join()Joins all elements of an array into a string. fn:length()Returns the number of items in a collection, or the number of characters in a string. fn:replace()Returns a string resulting from replacing in an input string all occurrences with a given string. fn:split()Splits a string into an array of substrings. fn:startsWith()Tests if an input string starts with the specified prefix. fn:substring()Returns a subset of a string. fn:substringAfter()Returns a subset of a string following a specific substring. fn:substringBefore()Returns a subset of a string before a specific substring. fn:toLowerCase()Converts all of the characters of a string to lower case. fn:toUpperCase()Converts all of the characters of a string to upper case. fn:trim()Removes white spaces from both ends of a string.

Hibernate Join Table Imagine that I am going to join multiple tables Users and UserData Create simple POJO class UserFullData.java

UserService.java

Thank you for attention