Arjun V. Bala Page 25



Similar documents
1 GETTING STARTED. 5/7/2008 Chapter 1

Dreamweaver MX Templates

Welcome to Microsoft Access Basics Tutorial

Responsive Design Fundamentals Chapter 1: Chapter 2: name content

Integrating With incontact dbprovider & Screen Pops

Emulated Single-Sign-On in LISTSERV Rev: 15 Jan 2010

Interworks Cloud Platform Citrix CPSM Integration Specification

Creating automated reports using VBS AN 44

SQL Perform Tools 5.10 Release Note

FOCUS Service Management Software Version 8.5 for Passport Business Solutions Installation Instructions

edoc Lite Recruitment Guidelines

LogMeIn Rescue Web SSO via SAML 2.0 Configuration Guide

Extending Microsoft Dynamics CRM 2013 Online Training

JAVA/J2EE Course Syllabus

Mobile Device Manager Admin Guide. Reports and Alerts

Readme File. Purpose. Introduction to Data Integration Management. Oracle s Hyperion Data Integration Management Release 9.2.

BackupAssist SQL Add-on

How To Install Fcus Service Management Software On A Pc Or Macbook

Kepware Technologies ClientAce: Creating a Simple Windows Form Application

TaskCentre v4.5 Send Fax (Tobit) Tool White Paper

Online Learning Portal best practices guide

FOCUS Service Management Software Version 8.5 for CounterPoint Installation Instructions

Serv-U Distributed Architecture Guide

Improved Data Center Power Consumption and Streamlining Management in Windows Server 2008 R2 with SP1

Ads SPA with AngularJS Lab

TaskCentre v4.5 Send Message (SMTP) Tool White Paper

User Guide Version 3.9

HTTPD - Apache2 Web Server

User Guide. Excel Data Management Pack (EDM-Pack) OnCommand Workflow Automation (WFA) Abstract PROFESSIONAL SERVICES. Date: December 2015

Helpdesk Support Tickets & Knowledgebase

FUJITSU Software ServerView Suite ServerView PrimeCollect

The user authentication process varies from client to client depending on internal resource capabilities, and client processes and procedures.

Access to the Ashworth College Online Library service is free and provided upon enrollment. To access ProQuest:

Prototype of a Web ETL Tool

INTEGRATION OVERVIEW. Introduction Authentication methods Learning management system (LMS) integration methods AICC standard...

WinFlex Web Single Sign-On (EbixLife XML Format) Version: 1.5

Outlook Plug-In. Send Conference Invites from Outlook. Downloading Outlook Plug-In CONFERENCING & COLLABORATION RESERVATIONLESS-PLUS

esupport Quick Start Guide

9 ITS Standards Specification Catalog and Testing Framework

WEB APPLICATION SECURITY TESTING

DocAve 6 ediscovery. User Guide. Service Pack 5. Revision B Issued February DocAve 6: ediscovery

Document Management Versioning Strategy

SYSTEM MONITORING PLUG-IN FOR MICROSOFT SQL SERVER

Data Abstraction Best Practices with Cisco Data Virtualization

Preparing to Deploy Reflection : A Guide for System Administrators. Version 14.1

Custom Portlets. an unbiased review of the greatest Practice CS feature ever. Andrew V. Gamet

Serv-U Distributed Architecture Guide

TheBrain 9 New Features and Benefits Overview

TaskCentre v4.5 File Management Tool White Paper

Co. Cavan VEC. Programme Module for. Web Design. leading to. Level 4 FETAC. Web Design 4N1122

Picture Menu Web Part. AMREIN ENGINEERING AG Version 1.0

Sitecore Serialization Guide

Frequently Asked Questions November 19, Which browsers are compatible with the Global Patent Search Network (GPSN)?

Tableau Advanced 2-Day Class

Configuring and Integrating LDAP

Welcome to CNIPS Training: CACFP Claim Entry

Connecting to

HarePoint HelpDesk for SharePoint. For SharePoint Server 2010, SharePoint Foundation User Guide

Project Startup Report Presented to the IT Committee June 26, 2012

1) Update the AccuBuild Program to the latest version Version or later.

efusion Table of Contents

Introduction to Mindjet MindManager Server

Copyright 2013, SafeNet, Inc. All rights reserved. We have attempted to make these documents complete, accurate, and

SortSite Technical Overview White Paper

LOTUS NOTES 8.5. Managing Tasks. Microcomputer Training Centre. Department of Human Resources and Employee Relations Learning and Development

Access EEC s Web Applications... 2 View Messages from EEC... 3 Sign In as a Returning User... 3

Getting Started Guide

SBClient and Microsoft Windows Terminal Server (Including Citrix Server)

DIRECT DATA EXPORT (DDE) USER GUIDE

Firewall/Proxy Server Settings to Access Hosted Environment. For Access Control Method (also known as access lists and usually used on routers)

Knowledge Base Article

LeadStreet Broker Guide

AvePoint Privacy Impact Assessment 1

Meet Moodle Students introduction to Moodle and

Employee Self Service (ESS) Quick Reference Guide ESS User

The Importance Advanced Data Collection System Maintenance. Berry Drijsen Global Service Business Manager. knowledge to shape your future

SOFTWARE DEVELOPER POSITION BY RIOMED LTD. SAFE. EFFICIENT. QUALITY WORLD CLASS HEALTHCARE SOLUTION

IPS VideoAnalytics V3.21. Interface Description API for IPS Analytics Applications on the Axis ACAP Platform

Getting started with Android

Messenger Project Acceptance Test Plan. Version 1.1

KronoDesk Migration and Integration Guide Inflectra Corporation

User Manual Brainloop Outlook Add-In. Version 3.4

White Paper for Mobile Workforce Management and Monitoring Copyright 2014 by Patrol-IT Inc.

Aras Innovator Internet Explorer Client Configuration

Aras Innovator Internet Explorer Client Configuration

BRILL s Editorial Manager (EM) Manual for Authors Table of Contents

Transcription:

15) Explain JSP unified Expressin Language (EL). (May-13, Jun-12) EL is a language that allws JSP prgrammers t fetch applicatin data stred in JavaBeans cmpnent. The fllwing methds are used t call the java cde frm a JSP page: 1. Placing the entire Java cde in a JSP page 2. Defining separate helper classes that encapsulate the entire Java cde and calling these helper classes frm a JSP page 3. Using JavaBeans and JSP page actin tags 4. Using JSP EL 5. Create tag handler classes t embed the Java cde The incrpratin f EL t the JSP has helped reduce the use f scriptles in JSP page. EL expressins prvide shrt hand ntatins t retrieve, present, and manipulate Web applicatin data. EL expressins are enclsed between the ${ and} characters. The mst general example f an EL expressin is ${bject.data} Where, bject can be any Java bject representing different scpe, such as request,sessin. EL expressings can be categrized int the fllwing types: 1. Immediate and deferred expressins 2. Value expressins 3. Methd expressins 1) Immediate and deferred expressins Tw cnstructs are used t represent EL expressins, ${ expr } used fr expressins that need t be evaluated immediately, and #{ expr } used fr expressins that need t be evaluated at later time. An expressin that uses ${ expr } is called immediate expressin and The expressin that uses #{ expr } is called deferred expressin. 2) Value Expressins Value epressins are used t refer t bjects such as JavaBeans, Cllectins, enumeratins and implicit bjects and their prperties. An bject is referred t by using the value expressin cntaining the name f the bject Suppse the ${ emplyee } expressin is used in a JSP page, where emplyee refers t the name f a Which searches fr the emplyee JavaBeab in the request, sessin and applicatin scpes If the emplyee JavaBean des nt exist, a null value is returned. Syntax f value expressin t access prperties and elements f a cllectin in java uses tw peratrs, (. ) and ( [] ). Fr example, The name prperty f the emplyee JavaBean can be referred as ${emplyee.name} r ${ emplyee[ name ] } expressin. T access a specific element f a cllectin, such as list r an array inside a JavaBean we can use ${ emplyee.name[0] }, ${ emplyee.name[1] }, etc The value expressins are f tw types: rvalue rvalue expressin can nly read data, and nt write data. lvalue lvalue expressin can read as well as write data. 3) Methd Expressins Methd expressins are used t call public methds, which returns a value r bject. Such expressins are usually deferred expressins. Arjun V. Bala Page 25

Tags usually use methd expressins t call functins that perfrm peratins such as validating a UI cmpnent r handling the events generated n a UI cmpnent. The fllwing cde snippet shws the use f methd expressins in JSF page: <h:frm> <h:inputtext id= email value= #{emplyee.email} validatr= #{emplyee.validateemail} /> <h:cmmandbuttn id= submit actin= #{custmer.submit} /> </h:frm> The varius elements shwn in the preceding cde snippet can be briefly described as fllws: The inputtext tag : shws the UIInput cmpnent in the frm f a text field n a webpage The validatr attribute : calls the validateemail methd f the emplyee JavaBean The actin attribute f the cmmandbuttn tag : calls the submit methd, which carries ut prcessing after submitting the webpage The validateemail methd : Refers t the methd that is called during the validatin phase f the JSP life cycle The submit methd : Refers t the methd that is called during the invke applicatin phase f the JSP life cycle 16) Enlist and explain the use f actin tags in JSP. (May-13,Jan-13) Actin tags are specific t a JSP page. When a JSP cntainer encunters an actin tag while translating a JSP page int a servlet, it generates a Java cde crrespnding t the task t be perfrmed by the actin tag. The fllwing are sme imprtant actin tags available in JSP page: 1. <jsp:include> The <jsp:include> actin tag facilitates Java prgrammers in including a static r dynamic resurce, such as an HTML r JSP page in the current JSP page. If the resurce t be included is static then its cntent is directly included. If the resurce is dynamic then first it is prcessed and result is included in page. Example <jsp:include page= test.jsp /> 2. <jsp:frward> The <jsp:frward> tag frwards a JSP request t anther resurce which can be either static r dynamic. If the request is frwarded t a dynamic resurce, a <jsp:param> tag can be used t pass a name and value f a parameter t a resurce. <jsp:frward page= /header.html /> 3. <jsp:param> The <jsp:param> tag allws Java prgrammers t pass a name and value f a parameter t a dynamic resurce, while including it in a JSP page r frwarding a request t anther JSP page. <jsp:param name= uname value= arjunbala /> Arjun V. Bala Page 26

4. <jsp:usebean> T separate te business lgic frm the presentatin lgic, it is ften a gd idea t encapsulate the business lgin in Java bject, and then instantiate and use this Java bject within a JSP page, <jsp:usebean> tag helps in such task. The <jsp:usebean> actin tag has certain attributes that add extra characteristics t it, sme attributes specific t <jsp:usebean> are: Id : represents the name assigned t a JavaBean, which is later used as a variable t access the JavaBean Class : takes the qualified class name t create a JavaBean instance if the JavaBean instance is nt fund in the given scpe. beanname : takes the qualified class name r expressin f a JavaBean t create a Class & beanname can nt be used tgether. We can nt use expressins t create instance f JavaBean frm class attribute, fr that we have t use beanname attribute. Scpe : represents the scpe in which a JavaBean instance has t be created. Page scpe : indicates that a JavaBean can be used where <jsp:usebean> actin tag is used. Request scpe : indicates that a JavaBean can be used frm any JSP page, which prcesses the same request until a respnse is sent t a client by the JSP page. Sessin scpe : indicates that a JavaBean can be used frm any JSP page invked in the same sessin as the JSP page that created the Applicatin scpe : indicates that a JavaBean can be used frm any JSP page in the same applicatin as the JSP page that created the Example : <jsp:usebean id= mybean class= MyBeanClass scpe= sessin >. </jsp:usebean> 5. <jsp:setprperty> The <jsp:setprperty> actin tag sets the value f a prperty by using the setter methd f a Befre using the <jsp:setprperty> actin tag, the JavaBean must be instantiated. Example: <jsp:setprperty name= beanname prperty= uname value= arjunbala /> 6. <jsp:getprperty> The <jsp:setprperty> actin tag retrives the value f a prperty by using the getter methd f a JavaBean and writes the value f the current JspWriter. <jsp:getprperty name= mybean prperty= uname /> 7. <jsp:plugin> The <jsp:plugin> actin tag prvides supprt fr including a Java applet r JavaBean in a client Web brwser, by using built-in r dwnladed Java plug-in. The <jsp:plugin> actin tag perfrm the fllwing peratins: Specify whether the cmpnent added in the <bject> tag is a JavaBean r an applet. Lcate the cde that needs t be run. Arjun V. Bala Page 27

Psitin an bject in the brwser windw. Specify a URL frm which the plug-in sftware is t be dwnladed. Pass parameter names and values t an bject <jsp:plugin attributes>. </jsp:plugin> 8. <jsp:params> The <jsp:params> actin tag sends the parameters that yu want t pass t an applet r <jsp:params> <!- ne r mre jsp:param tags --> </jsp:params> 9. <jsp:fallback> The <jsp:fallback> actin tag is allws yu t specify a text message that is displayed if the required plug-in cannt run. This tag must be used as a child tag with <jsp:plugin> actin tag. Example: <jsp:fallback> Text message that has t be displayed if the plugin cannt be started </jsp:fallback> 10. <jsp:attribute> The <jsp:attribute> actin tag is used t specify the value f a standard r custm actin attribute. <jsp:setprperty name= mybean > <jsp:attribute name= prperty >uname</jsp:attribute> <jsp:attribute name= value >Arjun Bala</jsp:attribute> </jsp:setprperty> 11. <jsp:bdy> The <jsp:bdy> actin tag is used t specify the cntent (r bdy) f a standard r custm actin tag. <jsp:userbean id= mybean >.. <jsp:bdy>. </jsp:bdy> </jsp:mybean> 12. <jsp:element> The <jsp:element> actin tag is used t dynamically define the value f the tag f an XML element. <jsp:element name= mytag > <jsp:attribute name= myatt >My Value </jsp:attribute> </jsp:element> 13. <jsp:text> A <jsp:text> tag is used t enclse template data in an XML tag. The cntent f the <jsp:text> bdy is passed t the implicit bject ut. <jsp:text> Hell wrld frm the actin tag </jsp:text> Arjun V. Bala Page 28

17) Explain JSP standard tag library (JSTL) with examples. (Jun-12,Nv-11) Initially, web designers used scriplets in JSP pages t generate dynamic cntent. This resulted in redability issues and als made it difficult t maintain the JSP page. Custm tags were intrduced t vercme the prblems faced in using scriplets, they had sme limitatins t. Web designers had t spend a lt f time in cding, packaging, and testing these tags befre using them. This meant that web designers were ften left with little time t cncentrate n the designing f web pages. The intrductin f JSTL has helped web designers vercme the shrtcmings f custm tags, by encapsulating the cmmn functinalities included the use f tag libraries, such as cre, SQL, and XML. The main features f JSTL are: Prvides supprt fr cnditinal prcessing and Unifrm Resurce Lcatr (URL)- related actins. Prvides the XML tag library, which helps yu t manipulate XML dcuments. Enables Web applicatins t be accessed glbally by prviding the internatinalizatin tag library. Enables interactin with relatinal databases by using varius SQL cmmands. Prvides series f functins t perfrm manipulatins. Tag Libraries in JSTL: Tag Library Functin URI prefix Cre tag library Variable supprt http://java.sun.cm/jsp/jstl/cre c Flw Cntrl Iteratr URL management Miscellaneus XML tag library Flw cntrl http://java.sun.cm/jsp/jstl/xml x Transfrmatin Lcale Internatinalizatin Message frmatting http://java.sun.cm/jsp/jstl/fmt fmt tag library Number and date frmatting SQL tag library Database manipulatin http://java.sun.cm/jsp/jstl/sql sql Functins Library Cllectin length String manipulatin http://java.sun.cm/jsp/jstl/functins fn Arjun V. Bala Page 29

Example f Cre tag library: <%@ taglib uri="http://java.sun.cm/jsp/jstl/cre" prefix="c" %> <html> <head> <title><c:chse> Tag Example</title> </head> <bdy> <c:set var="salary" scpe="sessin" value="${2000*2}"/> <p>yur salary is : <c:ut value="${salary}"/></p> <c:chse> <c:when test="${salary <= 0}"> Salary is very lw t survive. </c:when> <c:when test="${salary > 1000}"> Salary is very gd. </c:when> <c:therwise> N cmment... </c:therwise> </c:chse> </bdy> </html> Arjun V. Bala Page 30