当前web-xml的设置如下, <welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
现在我需要把<welcome-file>index.html</welcome-file>这部分
直接设置为 .do 的形式, 即请求方式。该怎么改呢?
<welcome-file>index.html</welcome-file>
</welcome-file-list>
现在我需要把<welcome-file>index.html</welcome-file>这部分
直接设置为 .do 的形式, 即请求方式。该怎么改呢?
解决方案 »
- 怎样实现jsp页面信息自动下滚
- java实现扫描条码上的工号后自动登录如何实现?
- 后台生成的Excel如何在Struts中直接下载?
- 让html的对象不显示成对象,而是以字符显示出来,恐怕是说得不明白,高手进来看看!!!!
- 怎么下载nexus.war
- 回压起什么作用?
- 网页中点对点即时通讯的问题
- 为什么建立虚拟目录时这样不行? <Context path="/xuu27" debug="0" docBase="C:\jsp\xuu27" reloadable="true" crossContext="true"/>
- jsp中的分页
- Tomcat做服务器,图片URL不变的时候如何强制刷新?
- 我想要在JavaScript中获得sturts标签的内容怎么做?
- 导入已存在的web项目,如何设置,将其运行!
配置一个全局转发
<global-forwards> [code=Java]
<forward name="findhistory" path="/findhistory.do"/>
</global-forwards>[/code]web.xml
配置
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>index.jsp 页面<logic:forward name="findhistory"/>
既可以了
<meta http-equiv="Refresh" content="0;url=/c1s/dispTop.do" />
所以
<welcome-file-list>
<welcome-file>index.html </welcome-file>
</welcome-file-list>
这么写的话正常执行,但是我现在要想不通过index.html, 直接在welcome-file上指定如下,例:
<welcome-file-list>
<welcome-file>dispTop.do</welcome-file>
</welcome-file-list>
有没有不通过index页面的方法?
<welcome-file>dispTop.do </welcome-file>
</welcome-file-list>
这种写法是不行的
web.xml文件配置不变
<welcome-file-list>
<welcome-file>index.html </welcome-file>
</welcome-file-list>
index.html
<HTML>
<HEAD>
<TITLE>welcome</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</HEAD>
<body>
<script language="javaScript">
window.location = "***.do";
</script>
</body>
</HTML>
大家给的方法都没错,但是不是我想要得,我就是想在welcomefile里直接写.do的方式。
现将我调试成功的方法贴出来,给大家参考。
这是web.xml的设定,struts.config的设定没变
<welcome-file>dispTop.do</welcome-file>
之后,我在项目根目录建立了一个名字为dispTop.do的空文件。
这样我的默认欢迎访问页面就是dispTop的action执行后的页面了。
还是感谢各位,结贴去了,分就给前面几位了,谢谢。