avatar
tomcat连接mysql求助# Java - 爪哇娇娃
w*o
1
本人完全新手,有一门课的作业要用到这个。
我已经配置好了tomcat 7.0.16和jdk1.6.0_26。
也配置好了mysql。
下载了mysql-connector-java-5.1.16。按照网上的教程,把mysql-connector-java-5.
1.16-bin.jar 放到了 tomcat的lib下面。
然后用mysql创建了database和table,
但是按照教程在tomcat\Root下面创建了test.jsp,然后再浏览器中打开http://localhost:8080/test.jsp总是显示http错误。
请问大家该这么做呢?
试了好多网上的教程多不对,然后我java基本上也是空白,刚刚开始学。
请教达人有教程,或是这点该从哪入手?多谢各位。
avatar
w*o
2
自己顶,现在自己正在看tomcat的文档,上面有介绍。先试试再说。
avatar
l*3
3
what did you get if you access
http://localhost:8080/
did you get default tomcat welcome page?

5.

【在 w******o 的大作中提到】
: 本人完全新手,有一门课的作业要用到这个。
: 我已经配置好了tomcat 7.0.16和jdk1.6.0_26。
: 也配置好了mysql。
: 下载了mysql-connector-java-5.1.16。按照网上的教程,把mysql-connector-java-5.
: 1.16-bin.jar 放到了 tomcat的lib下面。
: 然后用mysql创建了database和table,
: 但是按照教程在tomcat\Root下面创建了test.jsp,然后再浏览器中打开http://localhost:8080/test.jsp总是显示http错误。
: 请问大家该这么做呢?
: 试了好多网上的教程多不对,然后我java基本上也是空白,刚刚开始学。
: 请教达人有教程,或是这点该从哪入手?多谢各位。

avatar
w*o
4
我觉得是得到了default的welcome界面吧~~~
然后上面的链接都好用,例如上面有First Web Application。
avatar
w*o
5
配置了半天还是
HTTP Status 404 - /myapps/index.jsp
type Status report
message /myapps/index.jsp
description The requested resource (/myapps/index.jsp) is not available.
Apache Tomcat/7.0.16
avatar
g*g
6
This has nothing to do with mysql, I'd check server.xml and
web.xml

【在 w******o 的大作中提到】
: 配置了半天还是
: HTTP Status 404 - /myapps/index.jsp
: type Status report
: message /myapps/index.jsp
: description The requested resource (/myapps/index.jsp) is not available.
: Apache Tomcat/7.0.16

avatar
s*e
7
Check your deployment file structure. You should have some directory called
webapps/myapps in the tomcat root. And as myapps's direct child, you should
have index.jsp file. If you index.jsp is in myapps/WEB-INF, you will see the
error like this since you cannot access it from outside.
(actuallY once you fully understand how to deploy web app, you will know
that a url pattern can be forced to map any servlet/jsp inside WEB-INF) but
for a beginner I think that might be your problem.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。