|
JSP中文网提供的虚拟主机默认开通的时候,只有一个默认页面,index.jsp,里面仅有一句代码
out.println("hello,world");
但您可能希望改成其它的页面为默认页面,例如您希望更改为default.jsp为默认页面,大家却不知道该在什么地方去修改.特别是使用ASP习惯了的朋友们总是希望在什么地方可以看到有个 "默认页设置" 这样的一个功能, 但一直找不到,为什么呢?
原来JSP的默认页面设置集成在了自己的应用的配制中,记得有个web.xml嘛,里面有个welcome-file-list(可能您的web.xml没有,没有关系,加上就是了),这个就是设置默认页面的,也就是欢迎页!:)
在最后加上这么一段
<welcome-file-list> <welcome-file>default.jsp</welcome-file> <welcome-file>index.html</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
位于<web-aap>内,当然您需要注意的是webcome-file_list标签在web-aap内放在顺序,一定要放在最后,因为web.xml对标签顺序是有要求的.
<web-app > <display-name>photo525</display-name>
.................
<welcome-file-list> <welcome-file>default.jsp</welcome-file> <welcome-file>index.html</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
现在就知道了如何修改自己的默认页面了吧!:),完全由自己决定!
|