Javaweb Study Notes 1-jsp notes and page directives

Source: Internet
Author: User

There are two types of JSP annotations: 1. Explicit comments: syntax:<!--comment content--> the annotation client is allowed to see, and the other comment is the corresponding

2. Implicit annotations: (1) Comments inherited from Java style, (2) syntax: <%--comment Content--%> (this is a JSP comment), the client is not allowed to see

1 <!--This annotation client will be able to see -2 <%3     //single-line comment in Java, client cannot see4     /*5 multiple lines of comments in Java that the client cannot see6     */7 %>8 9 <%--can't see--%>

JSP must have web support when executing, need to start tomact

Results such as:

Page directive: syntax <% @page attribute%>, it is used to set the properties of the page and related functions, you can use it to import related classes, output format and so on.

Import Package: <% @page import= "package name. Class Name"%>

Set MIME: Normally contenttype= "text/html", output in HTML format, if you want to output in Word file, then set contenttype to "Application/word" to view the relevant mappings, You can consult the Tomcat/conf/web.xml file for more information.

Set file encoding: In JSP pure in pageencoding use pageencoding, not exist when use CharSet, and finally use ISO08859-1 encoding

Javaweb Study Notes 1-jsp notes and page directives

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.