1.2 introduction to the first jsp program (SUN enterprise-level application preferred:
1. Open a text editor or a jsp (preferred for SUN Enterprise Applications) Text Editor to highlight some syntax.
2. if you write a jsp (preferred for SUN Enterprise applications) to process http requests. It will be the same as compiling an html file.
3. a jsp (preferred for SUN Enterprise Applications) file should contain some jsp (preferred for SUN Enterprise Applications) commands (such as a taglib) enter <% @ %> 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 (preferred for SUN Enterprise applications. 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 (preferred for SUN Enterprise applications) /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 (preferred for SUN Enterprise Applications): 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 (preferred for SUN Enterprise Applications): useBean id = "date" class = "java. util. date "/> <C: out value = "$ {date}"/> </body>