JSP technology Overview

Source: Internet
Author: User
Tags html comment

Finally, I finished writing the servlet. In fact, I figured out the servlet. Then I thought it was very easy to look at the JSP. Later I wrote it quickly, and the notes were seriously lagging behind the reading progress.

Never forget that JSP technology is a server-side technology. jsp will be converted to servlet !!! Browsers Do not know JSP at all. They only see the output of JSP pages.

JSP and Servlet have their own advantages.


JSP basic syntax:

1. HTML text

HTML content, transmitted to the customer without modification


2. html comment

<--! HTML comment content --> sent to the customer, but not displayed by the browser


3. jsp comments

<% -- JSP comment content -- %> the developer comment is not sent to the client program


4. jsp expression

Calculate the value of each request page and send it to the client program

<% = Java Value %>


5. jsp scriptlet

One or more statements executed on each request page

<% Java code %>


6. jsp Declaration

When the page is converted to servlet, it becomes a part of the class definition field or Method

<%! Field defination %>

<%! Method defination %>


7. jsp commands

The high-level structure information of servlet code, the Code introduced during page conversion, or the custom tag library used

<% @ %>

Page

Include

Taglib


8. jsp action

Actions to be taken when a page is requested

JSP: Include

JSP: usebean

JSP: invoke


9. Custom tags (Custom Actions)

Call custom tags

<Prefix: Name>

Body

</Prefix: Name>


10. Escape template text

The text that requires special explanation, the slash is removed, and the remaining text is sent to the client.

<\ %

% \>


The usage will be discussed one by one later

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.