要想让你的http://localhost:8080/sample.jsp能显示,sample.jsp应该拷到tomcat目录里webapps\ROOT下,
win2000的iis端口是80,你直接输入http://localhost,就相当于http://localhost:80/
win2000的iis端口是80,你直接输入http://localhost,就相当于http://localhost:80/
调试欢乐多
2。你的代码有错误的String S应该大写
<%@page language="java"%>
<%@page info="a JSP example"%>
<html>
<head>
<title>a Jsp example</title>
</head>
<body>
<h1>
<%
String str;
str=new String("this is a string!");
%>
<%
out.print(str);
%>
</h1>
</body>
</html>3。你把sample.jsp拷贝到哪里了?应该是
d:\program files\apache group\\Tomcat 4.1\webapps\ROOT不过我估计你用的不是4.1。
所以你的状况可能是startup那个出来的控制台里已经打出了出错信息。
新的4.1出错也会在页面上打的。具体jsp放在那里之类的可以看和修改
\Tomcat 4.1\conf\server.xml
HTTP Status 404 - /simple.jsp--------------------------------------------------------------------------------type Status reportmessage /simple.jspdescription The requested resource (/simple.jsp) is not available.
--------------------------------------------------------------------------------Apache Tomcat/4.1.27
怎么回事阿?
simple.jsp代码:
<%@ page language="java" %>
<HTML>
<HEAD>
<TITLE> jsp </TITLE>
</HEAD>
<BODY>
<%
out.print("This is a simple jsp file!");
%>
</BODY>
</HTML>
只需要把.jsp放到d:\program files\apache group\\Tomcat 4.1\webapps\ROOT下
然后运行Tomcat
打开浏览器,输入http://localhost:8080/simple.jsp就成了
不过步骤莫弄错了哈