JSP syntax (JSP Technology) 1

Source: Internet
Author: User
Tags tld

A JSP Element

1. pseudoinstructions
<% @ %>
2. Statement
<%! %>
Scriplet
<%>
Expression
<% = %>
3. Notes
JSP annotation visible to the server
<% -- %>
HTML client visibility
<! -->
4. jsp Behavior
4.1 <JSP: usebean> declare a JavaBean instance
4.2 <JSP: setproperty> set one or more bean property values
4.3 <JSP: getproperty> return the attribute value specified by bean
4.4 <JSP: Include> call another resource and merge its output stream into the JSP page output stream
4.5 <JSP: Forward> forward the HTTP request to another JSP page or servlet for processing
4.6 <JSP: param> binds the value to a name and transfers the value to another resource called by <JSP: Include> or <JSP: Forward>.
4.7 <JSP: plugin> is used to generate html links for downloading Java Plug-ins.
5. Implicit object
Variables are implicitly valid (but not declared) in The Scriplet and expression ).
The request is being served by the servletrequest or httpservletrequest
Response receives the servletresponse or httpservletresponse that generates HTML output.
Pagecontext: The pagecontext object of the page. This object is the primary storage location of the page, request, session, and application attribute data.
Session if an httpsession is used on the JSP page
Application servlet context object
Out is used to generate the character output stream for HTML output.
Config the servletconfig object in the servlet context
A reference of the page JSP page itself
Exception causes an uncaptured overflow of the called error page. This variable is only available for pages with iserrorpage = "true.
6. Session
HTTP is a stateless protocol, which means that it does not remember everything in the previous request from one request to another.
However, web applications often call multiple requests.
Remember status:
Hide domain
Cookie
URL rewriting
HTTP session
7. Page Directive
<% @ Page attribute = "value" attribute = "value "...... %>
This directive provides the attribute method that affects page interpretation and execution methods.
7.1 Language
Java | Javascript
7.2 extends parent class
Interfaces required for JSP superclasses
Javax. servlet. jsppage
Javax. servlet. jsp. httpjsppage
7.3 classes required for import package
7.4 The default value of session is true. An http session is required.
7.5 buffer autoflush cache Model
7.6 isthreadsafe
7.7 info: Specifies the descriptive information of the JSP page
7.8 contenttype
7.9 errorpage as a special error page displayed during Overflow
7.10 iserrorpage whether the page has an error page
8. jsp tag Extension
8.1 define tags
<JSP: usebean>
8.2 create a TLD Portal
Tag library Descriptor
8.3 compile a Tag Processor
Write Java class implementation
8.4 add tags to JSP pages
<% @ Taglib prefix = "diag" // prefix
Uri = "/web_inf/TLDs/diagnostics. TLD" %>
Use tags
<Diag: getwebserver/>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.