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