我是菜鸟:tomcat装好后可以显示主界面,自带的例子也可以运行,为什么我的程序解析不了呢 “inex.jsp”这个文件存在吗,是不是应该是"index.jsp" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 第一个问题是不是在于你把index.jsp给打错了 你打的是"inex.jsp"第二个问题要取决于你的代码,把你的代码贴出来吧 是这个路径下的index01.jsphttp://localhost:8080/DefaultWebApp/index01.jsp代码如下:<%@ page contentType="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html><body><% Class.forName("org.gjt.mm.mysql.Driver").newInstance(); String url ="jdbc:mysql://localhost/hanbon_news?user=root&password=&useUnicode=true&characterEncoding=GB2312" ; //String url ="jdbc:mysql://localhost/db_name?user=yourusername&password=yourpassword&useUnicode=true&characterEncoding=GB2312" ;Connection conn= DriverManager.getConnection(url); Statement stmt=conn.createStatement();String query="select field_name from table_name order by id";ResultSet rs=stmt.executeQuery(query);while(rs.next()){ String s=rs.getString("field_name");//看准你的字段是不是字符型,不然就不能用getString,根据字段类使用getBoolean等等 out.print(s+"<br>");}%></body></html>--------------------------------------------------------------------错误如下:HTTP Status 404 - /index01.jsp--------------------------------------------------------------------------------type Status reportmessage /index01.jspdescription The requested resource (/index01.jsp) is not available.--------------------------------------------------------------------------------Apache Tomcat/5.0.27 1. inex.jsp不存在,检查文件名是否正确,注意大小写2。你下载的程序初始化代码存在问题,可能需要环境的支持,要看好他的说明文件 inex.jsp不存在。包的位置不对(可能)! 是不是web.xml没配好呀! 把webapps\ROOT下的WEB-INF文件夹考到你自己的文件夹下 ftp上传文件是总是0kb is exceeding the 65535 bytes limit求解? hibernate.cfg.xml的问题 关于resin服务器下开发jpa+struts2.0+spring+hibernate+dwr的数据库表的ORM配置问题 学了些技术,还没派上用场...,有没有好的地方可以跳啊。 java新手遇到问题 紧急求助,大家帮我看看这是个什么错误 100分求解:EJB部署出现的异常错误!!很奇怪!!! Petstore文件目录结构 正则表达式的意思 如何打开struts debug 信息 [Hibernate]Hibernate两表,多表如何关联?
第二个问题要取决于你的代码,把你的代码贴出来吧
http://localhost:8080/DefaultWebApp/index01.jsp代码如下:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost/hanbon_news?user=root&password=&useUnicode=true&characterEncoding=GB2312" ;
//String url ="jdbc:mysql://localhost/db_name?user=yourusername&password=yourpassword&useUnicode=true&characterEncoding=GB2312" ;Connection conn= DriverManager.getConnection(url);
Statement stmt=conn.createStatement();
String query="select field_name from table_name order by id";
ResultSet rs=stmt.executeQuery(query);
while(rs.next())
{
String s=rs.getString("field_name");//看准你的字段是不是字符型,不然就不能用getString,根据字段类使用getBoolean等等
out.print(s+"<br>");
}
%>
</body>
</html>--------------------------------------------------------------------
错误如下:
HTTP Status 404 - /index01.jsp--------------------------------------------------------------------------------type Status reportmessage /index01.jspdescription The requested resource (/index01.jsp) is not available.
--------------------------------------------------------------------------------Apache Tomcat/5.0.27
2。你下载的程序初始化代码存在问题,可能需要环境的支持,要看好他的说明文件
web.xml没配好呀!