請給出一個(gè)JSTL的helloWorld的最簡單例子
helloWorld:
注意當(dāng)做下面的項(xiàng)目時(shí),需要導(dǎo)入兩個(gè)包:jstl.jar和standard.jar。其它的就是單個(gè)單個(gè)的jsp了,比較簡單。
馬克- to-win:馬克 java社區(qū):防盜版實(shí)名手機(jī)尾號: 73203。
例 2.2.1
hello.jsp:
<%@ page contentType="text/html; charset=GBK" %>
<!--why here is http://java.sun.com/jsp/jstl/core,because lib/standard.jar/c.tld has a statement,
<uri>http://java.sun.com/jsp/jstl/core</uri>, you change there, then here you can also change.
I tried before. in internal tomcat you can not cahnge, but in the external tomcat,
you can change the content of c.tld.
-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.*"%>
<html>
<body>
<c:out value="你好,馬克-to-win!"/><br>
</body>
</html>
運(yùn)行jsp后,瀏覽器中輸出結(jié)果是:
你好,馬克-to-win!