JSP Standard Actions - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

JSP Standard Actions

Description:

The JSP specification defines a few standard action elements (built-in in JSP) The syntax: ... jsp:param name='bgcolor' value='cc00ff' / /jsp:params jsp:fallback ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 14
Provided by: tklak
Category:

less

Transcript and Presenter's Notes

Title: JSP Standard Actions


1
JSP Standard Actions
Celsina Bignoli bignolic_at_smccd.net
2
JSP Standard Actions
  • The JSP specification defines a few standard
    action elements (built-in in JSP)
  • The syntax
  • ltjspaction-name attr1value1 attr2value2gt
  • action_body
  • lt/jspaction-namegt
  • or (with no body)
  • ltjsp action-name attr1value1
    attr2value2 /gt

3
JSP Standard Actions - Example
  • ltjspforward pagenextPage.jspgt
  • ltjspparam nameaParam valueaValue /gt
  • lt/jspforwardgt
  • ltjspforward pagenextPage.jsp /gt

4
Standard Actions - Listing
ltjspattributegt ltjspbodygt ltjspdoBodygt ltjspelementgt ltjspforwardgt ltjspfallbackgt ltjspgetPropertygt ltjspincludegt ltjspinvokegt used in tag files used in JSP documents ltjspoutputgt ltjspparamgt ltjspparamsgt ltjspplugingt ltjsprootgt ltjsptextgt ltjspsetPropertygt ltjspuseBeangt

5
ltjspforwardgt
  • passes control to another JSP page or servlet
  • the execution of the current JSP page is
    terminated and control is fully passed to the
    target JSP
  • Syntax 1
  • ltjspforward pagepagePath /gt
  • Syntax 2
  • ltjspforward pagepagePath gt
  • ltone or more ltjspparamgt actions
  • lt/jspforwardgt

6
ltjspincludegt
  • includes the response of another JSP page,
    servlet or static file
  • the execution of the current JSP page continues
    after including the response generated by the
    target resource
  • the target resource has access to all the
    parameters and headers passed with the request.
  • Additional parameters can be passed using
    ltjspparamgt actions in the body of ltjspincludegt
  • Syntax 1
  • ltjspinclude pagepagePath /gt
  • Syntax 2
  • ltjspinclude pagepagePath gt
  • ltone or more ltjspparamgt actions
  • lt/jspincludegt

7
ltjspplugingt
  • used to download Java Plugin software and invoke
    a Java applet
  • Syntax
  • ltjspplugin typeapplet codeCode.class
    codebaserelativePath jreversionjreVersion
    heightheight widthwidth
    hspacehSpace vSpacevspace
    iepluginurlpluginURL nspluginurlpluginURL
    namenametitletitle gt
  • Optionally one ltjspparamsgt action and one
    ltjspfallbackgt action
  • lt/jspplugingt

8
ltjspparamsgt
  • can only be used within the body of a
    ltjspplugingt action to enclose a set of
    ltjspparamgt actions that specify the applet
    parameters
  • Syntax
  • ltjspparamsgt
  • One or more ltjspparamgt action
  • lt/jspparamsgt

9
ltjspfallbackgt
  • can only be used within the body of a
    ltjspplugingt
  • Specifies the template text to use for browser
    that dont support the lthtmlgt or ltobjectgt
    elements
  • Syntax
  • ltjspfallbackgt
  • Fallback body
  • lt/jspfallbackgt

10
ltjspplugingt - Example
  • ltjspplugin typeapplet codeClock2.class
    codebaseapplet jreversion1.2 width160
    height160 gt
  • ltjspparamsgt
  • ltjspparam namebgcolor valuecc00ff /gt
  • lt/jspparamsgt
  • ltjspfallbackgt
  • Plugin tag OBJECT or EMBED not supported by
    the
  • browser
  • lt/jspfallbackgt
  • lt/jspplugingt

11
ltjspattributegt
  • defines an attribute value for another jsp action
  • Syntax
  • ltjspattribute nameattrName gt
  • Attribute value
  • lt/jspattributegt

12
ltjspbodygt
  • defines the body for an action element
  • Only required when the action attributes are
    defined using ltjspattributegt
  • Syntax
  • ltjspbodygt
  • Body content
  • lt/jspbodygt

13
ltjspbodygt - Example
  • ltjspplugin typeapplet codeClock2.class
  • codebaseapplet jreversion1.2gt
  • ltjspattribute namewidthgt160lt/jspattributegt
  • ltjspattribute nameheightgt160lt/jspattributegt
  • ltjspbodygt
  • ltjspparamsgt
  • ltjspparam namebgcolor valuecc00ff /gt
  • lt/jspparamsgt
  • ltjspfallbackgt
  • Plugin tag OBJECT or EMBED not supported by
    the
  • browser
  • lt/jspfallbackgt
  • lt/jspbodygt
  • lt/jspplugingt
Write a Comment
User Comments (0)
About PowerShow.com