27
JSP Jsp is a web technology function which is used to develop server side web components. Jsp will be used in presentation layer. Complete jsp life cycle will be taken care by web container. Jsp page is combination of HTML elements and JSP elements. Following is the list of JSP elements: ---------- 1. Scripting elements Scriplets Expressions Declarations 2. Directives Page directives Include directives taglib directives 3. Standard elements <jsp:include> <jsp:forward> <jsp:param> <jsp:useBean> <jsp:setProperty> <jsp:getProperty> 4. Custom elements(Tags) Syntax: ---------- <% ---- ---- ---- ---- ---- %> Scriplets is used to write any valid java statement. All the elements inside the Scriplets must be terminated by semicolon. Example: -------- <% int a=10; out println(a); // Implicit object %> All the statements inside the Scriplets will be placed inside the service() method of translated servlet. Scripting Elements Expression Information About JSP by JLC www.jlcindia.c om [email protected]

Shyam

  • Upload
    phani

  • View
    213

  • Download
    0

Embed Size (px)

DESCRIPTION

shm

Citation preview

JSP Jsp is a web technology function which is used to develop server side web components. Jsp will be used in presentation layer. Complete jsp life cycle will be taken care by web container. Jsp page is combination of HTML elements and J! elements."ollowing is the list of J! elements# $$$$$$$$$$1. Scripting elements criplets %&pressions 'eclarations2. Directives !age directives (nclude directives taglib directives3. Standard elements )jsp#include* )jsp#forward* )jsp#param* )jsp#use+ean* )jsp#set!roperty* )jsp#get!roperty*,. Custom elements-Tags.Syntax: ----------)/$$$$ $$$$$$$$$$$$ $$$$/* criplets is used to write any valid java statement. 0ll the elements inside the criplets must be terminated by semicolon. %&ample# $$$$$$$$)/ int a1234out println-a.455 (mplicit object/* 0ll the statements inside the criplets will be placed inside the service-. method of translated servlet.Syntax# $$$$$$$$$$$$$$$$$$)/1e&p /*%&p#$$$$$)/16sri6/*)/1a/*)/1obj.m2-.4/* 7-invalid. %&pression is a short$cut form of out.println. Scripting ElementsExpressionn!ormation "#out JSP #y J$C%%%.&lcindia.comra&ivs'1(1)gmail.com 0ll the e&pression inside the J!8s will be placed inside the service-. method of translated servlet .ynta$$$$$$$$$$)/ 9$$$$$$$$$$$ $$$$$ $$$$$$$$$ /* (t is used to write variable declaration and method definition. Java statement are not allowed inside the declaration all the declaration inside the J! will be placed directly inside the translated servlet class and outside the service-. method.%&p# $$$$$$$$$$)/ 9 :oid m2-.;ystem.out.println-4:oid m2-.;ystem.out.println-&.4ystem.out.println-