路径这样设置有问题吗

sjj354 2012-02-22 02:48:08
工程目录:


web.xml:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>find</servlet-name>
<servlet-class>com.app.servlet.Find</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>find</servlet-name>
<url-pattern>/find</url-pattern>
</servlet-mapping>

浏览器中访问http://localhost:8080/buysearch/WebRoot/ 显示的是index.jsp页面,
点击跳转到find.jsp页面失败(此时链接为:http://localhost:8080/buysearch/find,
index.jsp文件中跳转路径为:<a href="find">
...全文
83 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
爱摸鱼de老邪 2012-02-22
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 helloworldhellobbboy 的回复:]

我咋觉得应该先访问:
http://localhost:8080/buysearch/index.jsp
微末加webroot?
[/Quote]
++
hellobbboy 2012-02-22
  • 打赏
  • 举报
回复
我咋觉得应该先访问:
http://localhost:8080/buysearch/index.jsp
微末加webroot?
  • 打赏
  • 举报
回复
从你贴出来的没看出哪里有问题
楼下来
wenjie4892543 2012-02-22
  • 打赏
  • 举报
回复
在Find类里面 断点调试 下!!
wenjie4892543 2012-02-22
  • 打赏
  • 举报
回复
我晕 看错 是拦截啊!!
wenjie4892543 2012-02-22
  • 打赏
  • 举报
回复
index.jsp文件中跳转路径为:<a href="find"> 我晕 啊 find.jsp
sjj354 2012-02-22
  • 打赏
  • 举报
回复
find是在WebRoot下的,链接http://localhost:8080/buysearch/find 没问题吗?
sjj354 2012-02-22
  • 打赏
  • 举报
回复
报错404错误
type Status report

message /buysearch/find

description The requested resource (/buysearch/find) is not available.
[Quote=引用 1 楼 neif1981 的回复:]

报错信息是什么?
[/Quote]
neif1981 2012-02-22
  • 打赏
  • 举报
回复
报错信息是什么?

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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