【www.gdgbn.com--js教程】

JSP的有它自己的节中的树脂的文件,下面是一个介绍性指南。

模板数据-的文本输出
除非特别标明,文中的JSP的文件将送交正是因为它是在文本文件中的一部分的反应。这就是所谓的模板数据的JSP技术规范。

JSP的埃尔和JSTL
JSP的电致发光是JSP的表达语言。它是用来评估表现,没有副作用(副作用是改变物体) 。利用电致发光是辨认它的语法: $ (表达式) 。

JSTL是JavaServer页面标准标签库,这是一套标签,用于创建动态输出从JSP的。这些标记看起来像普通的XML标记,并解释了树脂在翻译的时间来产生Java代码执行所期望的行动。

电致发光和JSTL用于整个讨论,树脂JSP的文件, JSP技术规范,以及JSTL规范提供更多的信息。

<%@page session="false" contentType="text/html" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>


A simple thing




<%-- this comment gets discarded when the JSP is translated into a Servlet --%>
<%
// some java code that makes the variable `x" available to EL
pageContext.setAttribute("x",new Integer(5));
%>

The value of x is ${ x }
The value of x + 2 is ${ x + 2 }
Is x
less than 6?

<%@include file="y.jsp" %>

inclide 文件,
Yes, it is true that x is less than 6, 
with a value of ${ x }
 
输出.
 

A simple thing





The value of x is 5.
The value of x + 2 is 7.
Is x
less than 6?

Yes, it is true that x is less than 6,
with a value of 5.

本文来源:http://www.gdgbn.com/wangyezhizuo/18262/