Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script » 精华  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to topicflat modethreaded modego to previous topicgo to next topicgo to back
作者 怎么在Tomcat里发布自己的程序?[精华]帖子............ [精华]
aiff





发贴: 85
于 2004-11-02 15:44 user profilesend a private message to usersend email to aiffreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
怎么在Tomcat里发布自己的程序?
http://www.china***net 作者:aile 发表于:2003-06-11 22:24:30

我刚开始学JSP,用WINXP+Tomcat4.1.24,在webapps目录下建立一个新目录myjsp,把自己写的jsp程序test.jsp放在里面,可是用http://localhost:8080/myjsp/test.jsp
无法运行(The requested resource (/begjsp-ch01/index.jsp) is not available)把它放在ROOT里用http://localhost:8080/test.jsp运行正常,
我应该怎么做?



【发表回复】【查看CU论坛原帖】【关闭】

--------------------------------------------------------------------------------
kpflysky 回复于:2003-06-12 08:38:32
同意
你主要是server.xml里面的映射没有弄清楚
默认的根目录是ROOT
所以你放到ROOT里就可以了



--------------------------------------------------------------------------------
badseed 回复于:2003-06-11 23:51:25
你有没有写web.xml
研究一下 webapps/examples/WEB-INF目录下的文件和目录结构
,再看看 web.xml的写法



--------------------------------------------------------------------------------
zhangv 回复于:2003-06-12 21:06:14
找到%tomcathome%\conf\server.xml文件,在<host>标签中加入:

<Context path="/虚拟目录名" docBase="本地路径" debug="0"
reloadable="true" crossContext="true">
</Context>
这样将你的jsp文件放到"本地路径"下,然后在浏览器中输入http://127.0.0.1:8080/虚拟目录名/xxx.jsp即可执行.
注意!!!还没有完!!这时候你的这个虚拟目录还没有执行servlet的能力(当然如果你不用servlet那就令当别论了).
下面是一个范例:

<Context path="/bbs" docBase="work" debug="0"
reloadable="true" crossContext="true">
</Context>
你要建一个名叫work的目录在webapps\下
要使这个work目录可以执行servlet,要有一个配置文件--web.xml,内容为:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>MyWEB</display-name>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
</web-app>

这个使最小配置,仅仅是指明servlet的位置.要把这个文件放到webapps\work\WEB-INF\下,你自己的servlet放到webapps\work\WEB-INF\classes\下.

手酸~^_^


aiff edited on 2004-11-25 16:04

作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
aiff





发贴: 85
于 2004-11-25 16:11 user profilesend a private message to usersend email to aiffreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
如还有问题请参考
http://www.cjsdn.net/post/view?bid=51&id=122917&sty=1 问题已经解决



作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
nayinian





发贴: 1
于 2004-12-03 09:01 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Smile谢谢了!好久都不能明白的问题终于懂了!


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
wuyng





发贴: 2
于 2004-12-30 22:02 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
明白了,很适合像我这样的初学都看! 3Q


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
star01cn





发贴: 8
于 2004-12-31 10:41 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
不太明白,直接在控制台里面配置连接不行吗?
为什么还要这么麻烦,我用的是Tongweb,
用Tomcat我想也应该差不多吧。



作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
jason25





发贴: 4
于 2005-03-16 12:14 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我也碰到类似的问题,知道默然目录是ROOT下,
可我在ROOT目录下新建了个文件夹,运行不能运行.显示
message /%E7%AC%AC5%E7%AB%A0/LOG.JSP
description The requested resource (/%E7%AC%AC5%E7%AB%A0/LOG.JSP) is not available.
可我把该LOG.JSP文件放在ROOT下就可以运行,
好头疼啊



作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
feng





发贴: 4
于 2005-04-06 17:59 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
谢谢


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
henbane





发贴: 42
于 2005-05-28 09:34 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我觉得大家是否在用最新的TOMCAT
我用那个直接在控制台,TOMCAT的ADMIN里,直接设置好,然后就可以运行了
根本就不用大家说的那样,非要改什么XML之类的文件。。。



作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
mhlovers





发贴: 14
于 2005-06-29 08:31 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
上面的两种说法都行!


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
gaohuawei





发贴: 5
于 2005-08-24 19:16 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我上的培训班才开始学Tomcat,老师为什么让开始用4.0呢?


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
deifrgw





发贴: 3
于 2005-10-27 10:12 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
谢谢,正需要,呵呵


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
andy_taoke





发贴: 15
于 2005-12-18 08:25 user profilesend a private message to usersend email to andy_taokereply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
嗯~~不错~~~我前两天一直想看这方面的内容~~~终于学会了~~3ks


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
zmy_niro





发贴: 4
于 2006-03-09 23:42 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我用的是tomcat5.5.11,我知道这个TOMCAT的ADMIN,可是我想装这个东西,但
http://tomcat.apache.org里好像没有提供这个的,请问哪里有下这个tomcat Admin呀?



作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
小小鱼





发贴: 2
于 2006-04-01 21:52 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我前几天也碰到过这个问题


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
小小鱼





发贴: 2
于 2006-04-01 21:52 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我前几天也碰到过这个问题


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
sunday_boy





发贴: 1
于 2006-04-05 17:26 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
但是在TOMCAT5.5的SERVER。XML没有

<Context path="/虚拟目录名" docBase="本地路径" debug="0"
reloadable="true" crossContext="true">
</Context>

这项设置

怎么办?



作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
sunjavaduke

乒乓球国手-张怡宁



发贴: 176
于 2006-05-05 15:48 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Tomcat已经出的版本很高了
也完善了很多
自己需要设置的东西已经简化了很多
建议使用新一些的版本
起码要是j2sdk 1.4+ tomcat 5.0



-----------------------------------------------------------------
icd.Neusoft Co,.Ltd.
mail:zhangzhongl@neusoft.com
tel:13591718127
QQ:176932855
------------------------------------------------------------------
作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
wbsljh





发贴: 1
于 2006-05-13 13:32 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看来这篇帖子还是很有代表性的阿


作者 Re:怎么在Tomcat里发布自己的程序?[精华]帖子............ [Re:aiff]
xiaoguo06





发贴: 1
于 2006-06-09 22:37 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我是初学者谢谢各位高手指教,呵呵,可以推荐我一些好书看吗,我才学的最好比较容易看懂的书,多谢拉



reply to topicflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923