当前位置:编程学习 > JS >>

Jsp&Servelet 学习笔记(2)

1.2第一个jsp(SUN企业级应用的首选)程序介绍:
 
1、    打开一个文本编辑器,或者一个jsp(SUN企业级应用的首选)专用的文本编辑器能标出一些语法的高亮。
2、    如果你编写一个jsp(SUN企业级应用的首选)来处理http请求那么。将会和编写html文件一样。
3、    一个jsp(SUN企业级应用的首选)文件如果要包含一些jsp(SUN企业级应用的首选)命令(列如一个taglib)的话要在文件开头写上<%@%>
4、    你可以在你需要的地方输入一个普通的表单提交或者用户标签。
5、    保存文件时以.jsp(SUN企业级应用的首选)为扩展名进行保存。在一个web应用中放在整个目录的顶层。既放在
Web-info同级目录下。
 
Example :
// 表示注释内容 <%-- --%>
<%-- use the taglib directive to make the JSTL 1.0 core tags available; use the uri "http://java.sun.com/jsp(SUN企业级应用的首选)/jstl/core" for JSTL 1.1 --%>//使用c:out标签http://www.knowsky.com/
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%-- use the jsp(SUN企业级应用的首选):useBean standard action to create the Date object; the object is set as an attribute in page scope --%>//在jsp(SUN企业级应用的首选)中使用javabean指明其(id)对象和(java.util.Date)类.
<jsp(SUN企业级应用的首选):useBean id="date" class="java.util.Date" /> <html><head><title>First jsp(SUN企业级应用的首选)</title></head><body><h2>Here is todays date</h2>//使用表达式输出${data}
<c:out value="${date}" /> </body></html>
补充:Web开发 , Jsp ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,