Jsp & amp; Servelet Study Notes (2)

Source: Internet
Author: User

1.2 introduction to the first jsp program:
 
1. Open a text editor or a jsp-specific text editor to highlight some syntaxes.
2. if you write a jsp to process http requests. It will be the same as compiling an html file.
3. If a jsp file contains some Jsp commands (such as a taglib), write <% @ %> at the beginning of the file.
4. You can enter a common form submission or user tag as needed.
5. Save the file with the. jsp extension. Put it on the top of the entire directory in a web application. Stored in
The Web-info directory at the same level.
 
Example:
// Indicates the comment content <% -- %>
<% -- Use the taglib directive to make the JSTL 1.0 core tags available; use the uri "http://java.sun.com/jsp/jstl/core" for JSTL 1.1 -- %> // use the c: out label http://www.knowsky.com/
<% @ Taglib uri = "http://java.sun.com/jstl/core" PRefix = "c" %>
<% -- Use the jsp: useBean standard action to create the Date object; the object is set as an attribute in page scope -- %> // specify its (id) object and (java. util. date) class.
<Jsp: useBean id = "date" class = "java. util. date "/> <C: out value = "$ {date}"/> </body>

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.