这是什么错误

guanjm 2004-09-21 03:48:59
type Status report

message /test/index.asp

description The requested resource (/test/index.asp) is not available.

JSP代码:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://diaoyudao:1433;DatabaseName=mole";
//pubs为你的数据库的
String user="sa";
String password="youarethebest";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from location";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {%>
您的第一个字段内容为:<%=rs.getString(1)%>
您的第二个字段内容为:<%=rs.getString(2)%>
<%}%>
<%out.print("数据库操作成功,恭喜你");%>
<%rs.close();
stmt.close();
conn.close();
%>
</body>
</html>
...全文
48 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
香芋元宇宙 2004-09-21
  • 打赏
  • 举报
回复
description The requested resource (/test/index.asp) is not available
这句话表明你要编译执行的文件,路径写的有错,也可能是文件名没写对,你把该文件存成 index.jsp

,如果没配置虚拟目录,就把这个文件放在目录Tomcat/webapps/root/下,然后打开IE,再地址栏写入如下地址:http://localhost:8080/index.jsp 就行了
tomuno 2004-09-21
  • 打赏
  • 举报
回复
tomcat的work目录下清空
qiyongjun2003 2004-09-21
  • 打赏
  • 举报
回复
/test/index.asp?
第一个问题是asp后缀?
还有就是你在server.xml中是否配置了虚拟目录?

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧