J2ee (JSP) (syntax part 1)

Source: Internet
Author: User
* JSP: running process on the server container:
After receiving a jsp file request from a customer, the container performs syntax analysis on the jsp file to generate the java servlet source file, compile the file, and then respond to the customer.
* JSP syntax:
# JSP commands
<% @ And %> is used only to set attributes related to the entire page.
There are three common commands
Page, include, taglib
1. page
<@ Page property = "value" property 2 = "value 2" %>
Page attributes:
Language indicates the script language. If it is used for multiple times, the first use prevails.
Example: <% @ page language = "java" %>
Method specifies the java program fragment attributes and method names. The valid values of this attribute include service, doGet, and doPost.
Example: <% @ page method = "doPost" %>
Import specifies the name of the imported java software package and the class name. The list is separated by commas (,). You can use this command to import different software packages multiple times.
Example: <% @ page import = "java. io. *, java. util. *" %>
Content_type specifies the MIME type of the response result. The default type is "text/html ",
The encoding format is "ISO-8859-1" and the language attribute is the same as the language, if the instruction is used multiple times
The first time is used.
<% @ Page content_type = "text/html, charset = GBK" %>
Session = "ture | false" specifies whether the JSP page uses session. The default value is true.
<% @ Page session = "true" %>
ErrorPage = "error_url" specifies the abnormal jump page
Example: <% @ page errorPage = "errorpage. jsp" %>
IsErrorPage = "ture | false"
Indicates whether the JSP webpage is an abnormal webpage.
<% @ Page isErrorPage = "true" %>

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.