如下就是我所用目录
每个文件的代码我都贴出来:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
index.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>
<body>
This is my JSP page. <br>
</body>
</html>
hellojstl.jsp:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ taglib prefix = "c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>test your first used JSTL page</title>
</head>
<body>
<c:out value="welcome test your first JSTL page"/><br>
you used the brower is: <br>
<c:out value="${header['User-Agent']}"/>
<c:set var="a" value="David O'Davies"/>
<c:out value="David O'Davies" escapeXml="true"/>
</body>
</html>
build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name = "JustTest" default = "deploy" basedir = ".">
<target name = "init">
<property environment = "env"/>
<property name = "src" value = "${basedir}/src" />
<property name = "webdir" value = "${basedir}/WebRoot" />
<property name = "classes" value = "${webdir}/WEB-INF/classes" />
<property name = "warpath" value = "D:\apache-tomcat-6.0.29\webapps" />
<property name = "" value = "" />
<mkdir dir = "${classes}" />
</target>