下面这段代码first.jsp放在tomcat\webapps下面,可是不能运行,为什么啊?
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*" %> <%!
private static int Num;
public void jspInit(){
Num = 0;
};
%>
<html>
<head>
<title>我的第一个JSP程序!!! </title>
</head>
<body>
<h1>
<%= "欢迎!" %>
<%
Num ++;
%>
<br>
<%= "您是第" + Num + "个客人!" %>
</h1>
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*" %> <%!
private static int Num;
public void jspInit(){
Num = 0;
};
%>
<html>
<head>
<title>我的第一个JSP程序!!! </title>
</head>
<body>
<h1>
<%= "欢迎!" %>
<%
Num ++;
%>
<br>
<%= "您是第" + Num + "个客人!" %>
</h1>
http://localhost:8080/hello/xx.jsp
<webapp>
</webapp>
web.xml应该有个xml文件头<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app> <display-name>Hello</display-name>
<description>
Hello World
</description></web-app>