welcome-file-list

  当客户访问Web应用时,如果仅仅给出Web应用的Root URL,没用指定具体的文件名,Web容器会自动调用Web应用的欢迎文件。      <welcome-file-list>   <welcome-file>welcome.jsp</welcome-file>   <welcome-file>index.jsp</welcome-file>   </welcome-fiel-list>      说明:<welcome-file-list>可以包含多个<welcome-file>子元素,首先查找第一个<welcome-file>文件。      由于<welcome-file-list>元素中不能配置Servlet映射,因此不能直接把Structs的Action作为欢迎文件,可以采用一种变通的方法来实现在欢迎文件中调用Structs Action。首先,在Structs配置文件中为被调用的Action创建一个全局的转发项,例如:   <global-forwards>   <forward name=”welcome” path=”HelloWord.do”/>   </global-forwords>      创建一个welcome.jsp的文件      最后在web.xml文件中把welcome.jsp文件配置为欢迎文件,代码如下:   <welcome-file-list>   <welcome-file>welcome.jsp</welcome-file>   </welcome-file-list>
<welcome-file-list>是一个在web.xml中配置的标签,用于设置网站的默认首页。在这个标签中,可以设置多个<welcome-file>,容器启动后会按照设置的顺序在根目录下查找匹配的物理存在的文件,并返回第一个找到的文件作为首页。如果没有找到匹配的文件,则会返回404错误。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* [welcome-file-list](https://blog.csdn.net/weixin_54010017/article/details/124711057)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [tomcat首页welcome-file-list设置与url-pattern匹配规则](https://blog.csdn.net/xybz1993/article/details/81023955)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [web.xml中的welcome-file-list标签作用](https://blog.csdn.net/ningmeng666_c/article/details/115538178)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值