welcome页面配置,高分相赠送

ryuginka 2006-08-11 12:03:39
我想输入http://localhost:8080/sample后,直接运行sample.do

①struts.config.xml:
<global-forwards>
<forward
name="welcome"
path="/MyLoinTop.do"/>
</global-forwards>
②自己所建工程下的web.xml
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
③welcome.jsp中加了这样一句:
<html:link forward="welcome">
④server.xml中配置了contextpath

以上配置后,直接输入http://localhost:8080/sample,并不能到我想要的MyLoinTop.do

注意:
不能改变tomcat下的web.xml,而是配置我自己工程的web.xml
...全文
281 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
dreamover 2006-08-15
  • 打赏
  • 举报
回复
早就说过了,<logic:redirect forward="welcome"/>就可以,不会用那是你领会不了
ryuginka 2006-08-15
  • 打赏
  • 举报
回复
自己搞定了。
我是通过一个index.jsp直接跳转到我要的页面,
这样来达到我要的效果。

<welcome-file>sample.do</welcome-file>
这种是绝对错误的,不能这样配置。

haitao8686 2006-08-13
  • 打赏
  • 举报
回复
<welcome-file-list>
<welcome-file>XXXXX.jsp</welcome-file>
</welcome-file-list>
flyingdancing2005 2006-08-13
  • 打赏
  • 举报
回复
<welcome-file>sample.do</welcome-file>
----------------------------------------
不能直接配置.do
lbx19822004 2006-08-13
  • 打赏
  • 举报
回复
楼上的是正确答案。
ryuginka 2006-08-11
  • 打赏
  • 举报
回复
up
yaray 2006-08-11
  • 打赏
  • 举报
回复
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.jsp</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>sample.do</welcome-file><!-- ........... -->
</welcome-file-list>
feigme 2006-08-11
  • 打赏
  • 举报
回复
<html:link forward="welcome"/>

楼主的加上"/"也可以
feigme 2006-08-11
  • 打赏
  • 举报
回复
<logic:redirect forward="welcome"/>
dreamover 2006-08-11
  • 打赏
  • 举报
回复
<logic:redirect forward="welcome"/>
seesea10523 2006-08-11
  • 打赏
  • 举报
回复
welcome.jsp 的 load()方法中加MyLoinTop.do
MichaelGates 2006-08-11
  • 打赏
  • 举报
回复
up
flyingdancing2005 2006-08-11
  • 打赏
  • 举报
回复
http://localhost:8080/sample/ 加一个斜杠
ryuginka 2006-08-11
  • 打赏
  • 举报
回复
up
shuiwuya 2006-08-11
  • 打赏
  • 举报
回复
<html:redirect forward="welcome">

67,516

社区成员

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

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