What is a JSP?

Source: Internet
Author: User

What is a JSP?
Sun company developed a server-side dynamic page technical specifications.
JSP is actually a "jsp" suffix of the file, the content of the file is mainly HTML and a small amount of Java code, the container will automatically convert the JSP file into a servlet and then execute.
How do I write a JSP file?
Step1, create a file with a suffix of ". jsp".
Step2, in the file, add the following content:
(1) HTML (css.js): Write directly.
(2) Java code
1) Java code snippet
<% Java statements; %>
2) JSP expression
<%=java expression%>

(3) Implied object
1) What is a hidden object
in a JSP file, objects that can be used directly, such as Out,request,response.
2) Why are these hidden objects directly available?
(4) instruction
1) Notifies the container to do some extra processing when translating the JSP file into a servlet class, such as a guide package.
2) Instruction syntax
                     <%@ directive Name attribute = attribute value%>
3) PA GE directive
A.import properties: Guide package
such as <% @page import= "java.util.*"%>
B.contenttype properties: Settings
The content of the Response.setcontenttype.
C.pageencoding Property: Tells the container JSP file encoding
(some containers, when reading the contents of the JSP file, the default
is to follow the ios-8859-1 to decode, if the JSP file inside
contains Chinese, garbled).


How is JSP executed?
Step1, the container converts the JSP file into a servlet class.
HTML (CSS,JS)-------> Service method, use Out.write output.
<% Java statement%>-------> Service method, copy.
<%=java expression%>-------> Service method, Output using Out.print (Java expression).
Step2, the container invokes the servlet.

What is a JSP?

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.