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>