当前位置:编程学习 > JAVA >>

路径问题

最近学校在实训,然后在实现jsp与servelet之间的调转时老是报404错误,他们分别有自己的包,请问各位,有什么方法吗,或者能够对路径问题有了解的,谢谢啦 --------------------编程问答-------------------- servlet是需要在服务启动的时候加载的,其中包括包路径名及访问名称等这些内容需要配置,启动成功后可通过url直接访问该servlet
--------------------编程问答-------------------- 我启动了服务的,之前是没按老师的要求建包,都是建在根目录下,但是都可以正常运行,但是建完之后,完了,全部都报404错误了 --------------------编程问答-------------------- 你先直接在浏览器里面访问你的servlet和jsp试试,如果访问成功再直接转发,转发的时候是相对路径这个得注意一下 --------------------编程问答-------------------- servlet接收到请求后返回一个jsp的路径,你确定那个路径对么? --------------------编程问答-------------------- 路径肯定是错的,因为之前能够正常运行,所以就是不知道怎么解决路径问题,不会 --------------------编程问答-------------------- 路径你看看。ip:端口/项目名 接下来就是具体的问题是路径
--------------------编程问答-------------------- 我上下图吧 --------------------编程问答-------------------- 除 --------------------编程问答-------------------- 除 --------------------编程问答-------------------- 这是要干嘛? --------------------编程问答--------------------
引用 8 楼 u013181653 的回复:
http://6.007zhenrenyulecheng1.com
http://6.12betyulecheng1.com
http://6.188jinbaoboyulecheng1.com
http://6.360yulecheng1.com
http://6.362yulecheng2.com
http://6.3uyulecheng3.com
http://6.500wanyulecheng3.com
http://6.508yulecheng1.com
http://6.518yulecheng2.com
http://6.51yulecheng1.com
http://6.58yulecheng3.com
http://6.678yulecheng33.com
http://6.873yulecheng1.com
http://6.888zhenrenyulecheng1.com
http://6.88yulecheng67.com
http://6.88zhenrenyulecheng1.com
http://6.91yulecheng3.com
http://6.99zhenrenyulecheng1.com
http://6.9dianxixiyulecheng3.com
http://6.a8yulecheng12.com
http://6.aimeiyulecheng1.com
http://6.amaniyulecheng5.com
http://6.aodaliyayulecheng1.com
http://6.aomenyulecheng33.com
http://6.aosikayulecheng3.com
http://6.babilunyulecheng5.com
http://6.badashengyulecheng1.com
http://6.badengyulecheng2.com
http://6.baiheyulecheng5.com
http://6.baijiaboyulecheng11.com
http://6.baijinyulecheng3.com
http://6.bailaohuiyulecheng3.com
http://6.bailefangyulecheng9.com
http://6.bailemenyulecheng2.com
http://6.bailigongyulecheng89.com
http://6.baishengyulecheng2.com
http://6.baiweiyulecheng9.com
http://6.bandaoyulecheng1.com
http://6.baolongyulecheng33.com
http://6.baomahuiyulecheng22.com
http://6.baomayulecheng2.com
http://6.baoshijieyulecheng23.com
http://6.bateyulecheng5.com
http://6.baxiyulecheng8.com
http://6.benchiyulecheng1.com
http://6.bet365yulecheng1.com
http://6.binhaiwanyulecheng1.com
http://6.binliyulecheng1.com
http://6.bocaiyulecheng3.com
http://6.boebaiyulecheng78.com
http://6.bofayulecheng2.com
http://6.bogouyulecheng1.com
http://6.bojiuyulecheng2.com
http://6.bojueyulecheng33.com
http://6.boshiyulecheng1.com
http://6.bossyulecheng5.com
http://6.botiantangyulecheng7.com
http://6.bozhidaoyulecheng1.com
http://6.bujiadiyulecheng5.com
http://6.buyechengyulecheng1.com
http://6.caishenyulecheng12.com
http://6.ceoyulecheng22.com
http://6.changjiangyulecheng2.com
http://6.chuanqiyulecheng5.com
http://6.chunvxinghaoyulecheng5.com
http://6.dadiyulecheng5.com
http://6.dadouhuiyulecheng2.com
http://6.易做图yulecheng11.com
http://6.dafengshouyulecheng11.com
http://6.dafuhaoyulecheng6.com
http://6.dajiawangyulecheng11.com
http://6.dalaoyulecheng11.com
http://6.dasanbayulecheng8.com
http://6.dashanghaiyulecheng7.com
http://6.dashijieyulecheng12.com
http://6.dawanjiayulecheng22.com
http://6.daxiyangyulecheng2.com
http://6.dayingjiayulecheng3.com
http://6.dazhonghuayulecheng2.com
http://6.dazhongyulecheng2.com
http://6.dejinyulecheng3.com
http://6.dingfengyulecheng3.com
http://6.dingjianyulecheng11.com
http://6.dingjiyulecheng2.com
http://6.dinglongyulecheng3.com
http://6.diwangyulecheng5.com
http://6.dongfanghongyunyulecheng1.com
http://6.dongfangxiaweiyiyulecheng6.com
http://6.doufangyulecheng1.com
http://6.duolunduoyulecheng7.com
http://6.duwangyulecheng5.com
http://6.eryeyulecheng8.com
http://6.eshiboyulecheng33.com
http://6.ewinyulecheng33.com
http://6.falaliyulecheng5.com
http://6.fazhongfayulecheng3.com
http://6.fenghuangyulechengyulecheng1.com
http://6.fubusiyulecheng3.com
http://6.g3yulecheng5.com
http://6.gaodianyulecheng1.com
http://6.gaoerfuyulecheng5.com
http://6.gongfuyulecheng5.com
http://6.gonghaiduchuanyulecheng1.com
http://6.guangfayulecheng2.com
http://6.guizuyulecheng23.com
http://6.hailifangyulecheng23.com
http://6.haishanghuanggongyulecheng7.com
http://6.haiwangxingyulecheng22.com
http://6.haolaiwuyulecheng2.com
http://6.haomenyulecheng2.com
http://6.haowangjiaoyulecheng3.com
http://6.haoxiangboyulecheng11.com
http://6.haruisiyulecheng1.com
http://6.hong9yulecheng3.com
http://6.hongbaoshiyulecheng7.com
http://6.hongboyulecheng1.com
http://6.hongshulinyulecheng3.com
http://6.hongtaokyulecheng33.com
http://6.hongyunyulecheng1.com
http://6.huangchengyulecheng3.com
http://6.huangguanyulecheng3.com
http://6.huangjiajinbaoyulecheng6.com
http://6.huangmayulecheng1.com
http://6.huangshiyulecheng2.com
http://6.huanleguyulecheng9.com
http://6.huanqiuyulecheng33.com
http://6.huaqiaorenyulecheng3.com
http://6.huashengdunyulecheng7.com
http://6.huaxiayulecheng1.com
http://6.huboyulecheng1.com
http://6.huifengyulecheng6.com
http://6.huihuangyulecheng1.com
http://6.huiliyulecheng3.com
http://6.jiaduobaoyulecheng9.com
http://6.jiaheyulecheng3.com
http://6.jiangjunyulecheng8.com
http://6.jiangshanyulecheng3.com
http://6.jianianhuayulecheng11.com
http://6.jiazhouyulecheng7.com
http://6.jiebaoyulecheng3.com
http://6.jiliyulecheng5.com
http://6.jinbaiyiyulecheng1.com
http://6.jinbangyulecheng7.com
http://6.jinbaoboyulecheng1.com
http://6.jinboshiyulecheng11.com
http://6.jincaiyulecheng3.com
http://6.jindouyulecheng1.com
http://6.jingchengyulecheng3.com
http://6.jinguangdadaoyulecheng5.com
http://6.jinguanyulecheng23.com
http://6.jinhaianyulecheng5.com
http://6.jinhuayulecheng7.com
http://6.jinjieyulecheng1.com
http://6.jinlongyulecheng7.com
http://6.jinmantangyulecheng22.com
http://6.jinmayulecheng3.com
http://6.jinmumianyulecheng22.com
http://6.jinqianbaoyulecheng7.com
http://6.jinshayulecheng1.com
http://6.jinyindaoyulecheng5.com
http://6.jinyuyulecheng5.com
http://6.jinzanyulecheng6.com
http://6.jinzitayulecheng5.com
http://6.jiujinshanyulecheng11.com
http://6.jiuzhouyulecheng33.com
http://6.jizhoudaoyulecheng5.com
http://6.jjyulecheng11.com
http://6.jubaopenyulecheng4.com
http://6.junyiyulecheng3.com
http://6.juxingyulecheng3.com
http://6.k7yulecheng22.com
http://6.kadilayulecheng2.com
http://6.kaishiyulecheng3.com
http://6.kaisiyulecheng1.com
http://6.kaixuanmenyulecheng12.com
http://6.kakawanyulecheng3.com
http://6.kelakeyulecheng2.com
http://6.kenboyulecheng1.com
http://6.kongchengchengshiyulecheng1.com
http://6.kongjunyihaoyulecheng5.com
http://6.ktvyulecheng3.com
http://6.kuaihuoyulecheng1.com
http://6.lanbaoshiyulecheng2.com
http://6.lanbojiniyulecheng5.com
http://6.languifangyulecheng4.com
http://6.laokyulecheng7.com
http://6.laolishiyulecheng7.com
http://6.laoqianzhuangyulecheng5.com
http://6.lasiweijiasiyulecheng5.com
http://6.lebaijiayulecheng3.com
http://6.lebaoyulecheng2.com
http://6.letiantangyulecheng1.com
http://6.letianyulecheng3.com
http://6.lezhongleyulecheng4.com
http://6.liaoyulecheng23.com
http://6.liboyulecheng2.com
http://6.ligaoyulecheng1.com
http://6.lijiboyulecheng2.com
http://6.lilaiyulecheng1.com
http://6.lixingyulecheng3.com
http://6.longboyulecheng2.com
http://6.longchengyulecheng2.com
http://6.lukesuoyulecheng3.com
http://6.luofugongyulecheng5.com
http://6.luokeyulecheng3.com
http://6.luomayulecheng8.com
http://6.luyishisanyulecheng8.com
http://6.madeliyulecheng3.com
http://6.makeboluoyulecheng5.com
http://6.manhadunyulecheng6.com
http://6.mapaiyulecheng6.com
http://6.meigaomeiyulecheng3.com
http://6.menghuanchengyulecheng1.com
http://6.mengtekaluoyulecheng7.com
http://6.milanyulecheng2.com
http://6.mingshengyulecheng1.com
http://6.mingshiyulecheng3.com
http://6.mingzhuyulecheng2.com
http://6.miqilinyulecheng3.com
http://6.moerbenyulecheng5.com
http://6.monageyulecheng3.com
http://6.mudanyulecheng3.com
http://6.muxingyulecheng3.com
http://6.niaochaoyulecheng3.com
http://6.niuyueyulecheng2.com
http://6.nuobeieryulecheng3.com
http://6.nvshenyulecheng5.com
http://6.nvyouyulecheng1.com
http://6.ouhuayulecheng1.com
http://6.oukaiyulecheng1.com
http://6.ouzhouyulecheng2.com
http://6.pukewangyulecheng3.com
http://6.qianguiyulecheng1.com
http://6.qianyiyulecheng7.com
http://6.qijiyulecheng3.com
http://6.qipaiyulecheng1.com
http://6.qipilangyulecheng11.com
http://6.quaomenyulecheng3.com
http://6.renniboyulecheng1.com
http://6.ruifengyulecheng1.com
http://6.ruishiyulecheng5.com
http://6.sanguoyulecheng3.com
http://6.sanxingyulecheng22.com
http://6.sanyayulecheng11.com
http://6.shengdayulecheng7.com
http://6.shengdeyulecheng1.com
http://6.shengtaoshayulecheng22.com
http://6.shenhuayulecheng22.com
http://6.shenzhouyulecheng5.com
http://6.shijiayulecheng2.com
http://6.shijiebeiyulecheng2.com
http://6.shiliupuyulecheng11.com
http://6.shisanzhangyulecheng11.com
http://6.shishiboyulecheng55.com
http://6.shouxiyulecheng5.com
http://6.shuijingchengyulecheng2.com
http://6.suoleieryulecheng9.com
http://6.suoluomenyulecheng5.com
http://6.taiziyulecheng23.com
http://6.tangrenjieyulecheng7.com
http://6.taobaoboyulecheng11.com
http://6.tianboyulecheng3.com
http://6.tianchengyulecheng1.com
http://6.tianjiangyulecheng2.com
http://6.tiankongyulecheng3.com
http://6.tianlongyulecheng1.com
http://6.tianlongyulechenghuangguanwang1.com
http://6.tianmaoyulecheng5.com
http://6.tianshangrenjianyulecheng6.com
http://6.tiantangniaoyulecheng7.com
http://6.tiantianleyulecheng8.com
http://6.tiantianyulecheng2.com
http://6.易做图yulecheng5.com
http://6.tonghuashunyulecheng11.com

这哥们给谁回复都是这,请问你是在帮csdn做测试还是。。。
404问题这是作为一个程序员刚开始写程序必须遇到的问题,不要急,静下心来,慢慢找,写程序最怕的问题不是404、500等,最怕的是不报错也不出来。这是最头痛地。。这只是你作为一个程序员噩梦的刚开始。 --------------------编程问答-------------------- 我用的spring3,应该有个WEB-INF文件夹,我的jsp文件放在这个文件夹下。
是在xml里面配路径的前后缀。
<bean
 class="org.springframework.web.servlet.view.InternalResourceViewResolver"
 p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />
控制器返回的路径是这样的:
@RequestMapping(value = "/welcome.service")
public String welcome(HttpServletRequest request, Model model)
{
return "/index";
}
就等于返回了路径“/WEB-INF/jsp/index.jsp” --------------------编程问答-------------------- 我不是放在web inf下面,其实主要是在webcontent里面建了包的影响  这个需要不断地测试,才知道怎么写,我是想在xml文件里,写个什么,最好能解决,这样就能在jsp和servelet里面就没那么麻烦了 --------------------编程问答-------------------- servelet配置的时候你可以把它配置到你的jsp所在的文件夹下:
/jsp所在的文件夹/servelet请求名,这个时候你在jsp中直接用serve了他请求名就行了,因为他们在同一个文件夹下。
如果不配置直接:/servelet请求名  这个时候你的servelet请求相当于在myeclipse中项目的webcontent下,
在服务器上相当于在你的工程名文件加下,你要是用的时候相对路径../jsp包/servelet请求名,

你也可以写绝对路径从项目名开始。 --------------------编程问答-------------------- 我后来是根据绝对路径写的,但是好像也报错了啊  纠结
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,