my Presentation on JSP and servlet

Embed Size (px)

Citation preview

  • 8/7/2019 my Presentation on JSP and servlet

    1/21

  • 8/7/2019 my Presentation on JSP and servlet

    2/21

    Web application

    Web application component

    Presentation logicApplication or business logic

    Data access logic

  • 8/7/2019 my Presentation on JSP and servlet

    3/21

    One tier architecture:In this code related topresentation, business and database logic areall clubbed together.

    Two tier architecture:The code related to dataaccess logic is separated from the othercomponent.and any interaction with datathrough business tier.

    Three tier architecture:In this coder

    elated to allthree components is separated from each other.However , now business tier acts as interfacebetween data tier and presentation tier can notdirectly communicate with the tier.

  • 8/7/2019 my Presentation on JSP and servlet

    4/21

    Basic servlet:A servlet is a program written

    in java, which runs on server ,processes the

    requested information and sends to theclient.

    Life cycle of servlet

    init()service()

    destroy()

    Servlet hierarchy

  • 8/7/2019 my Presentation on JSP and servlet

    5/21

    Servlet hierarchy

  • 8/7/2019 my Presentation on JSP and servlet

    6/21

    Servlet lifecycle

    Init()

    Service()

    Destroy()

  • 8/7/2019 my Presentation on JSP and servlet

    7/21

  • 8/7/2019 my Presentation on JSP and servlet

    8/21

    Session tracking :session tracking allow the

    server to keep a track of successive request

    made by the same client. Session tracking technique

    user authorization

    hidden fr

    om fieldURL rewriting

    cookies

    Servlet context

  • 8/7/2019 my Presentation on JSP and servlet

    9/21

    JSP:java server page is an exciting new

    technology that provide powerful and

    efficient creation of dynamic content.JSP is apresentation layer technology that allows

    static web content to be mixed with javacode.

  • 8/7/2019 my Presentation on JSP and servlet

    10/21

    Advantage ofJSP VersusASP: better language for dynamic part,

    portable Versus PHP: better language for dynamic part

    Versus pure servlets: more convenient to create

    HTML

    VersusSSI: much more flexible and powerful Versus JavaScript: server-side, richer language

    Versus static HTML: dynamic features

  • 8/7/2019 my Presentation on JSP and servlet

    11/21

    JSP life cycle Translation

    Compilation

    Execution

  • 8/7/2019 my Presentation on JSP and servlet

    12/21

    JSP

    containing java code embedded directly into an

    HTML tags page by using special tags.Automatically incorporates change made to my files.

    servlet

    consist of an HTML file for static content and the javafor dynamic content.

    Require recompilation if changes are made to any ofthe file.

  • 8/7/2019 my Presentation on JSP and servlet

    13/21

    JSPScripting Element Expression

    SriptletsDeclaration

    JSPDirectives page

    Includetaglib

  • 8/7/2019 my Presentation on JSP and servlet

    14/21

    Input andoutput objects

    Request

    ResponseOut

    Scope communication objects

    Session

    Application

    Page context

  • 8/7/2019 my Presentation on JSP and servlet

    15/21

    Servlet objects

    Page

    Config Error objects

    Exception

  • 8/7/2019 my Presentation on JSP and servlet

    16/21

    A Javabean is a special type of class that has anumber of methods. The JSP page can call

    these methods so can leave most of the code inthese Javabeans.

    Javabean could be used in another page

    (promoting reuse).

  • 8/7/2019 my Presentation on JSP and servlet

    17/21

    A JSP page can call java Bean method using

    JSP standard action.JSP standard action are

    performed when the browserrequest a JSPpage. these action can be used to include files

    or content of another page.

  • 8/7/2019 my Presentation on JSP and servlet

    18/21

    There are basic five types ofJSP standard

    action

  • 8/7/2019 my Presentation on JSP and servlet

    19/21

    JSP expression language can be used to

    display the generated dynamic content in a

    table on a web page. Expression language is aprimary feature of the JSP technology.The

    syntax forJSP expression language is:$ {EL expression}

  • 8/7/2019 my Presentation on JSP and servlet

    20/21

    A custom tag is a user-defined JSP language element. When a

    JSP page containing a custom tag is translated into a

    servlet, the tag is converted to operations on an object

    called a tag handler. The Web container then invokes thoseoperations when the JSP page's servlet is executed.

    Custom tags have a rich set of features. They can

    Be customized via attributes passed from the calling page.

    Access all the objects available to JSP pages.

    Modify the response generated by the calling page.

  • 8/7/2019 my Presentation on JSP and servlet

    21/21

    THANK YOU