当前web-xml的设置如下,  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
现在我需要把<welcome-file>index.html</welcome-file>这部分
直接设置为  .do 的形式, 即请求方式。该怎么改呢?

解决方案 »

  1.   

    在struts-conf.xml
    配置一个全局转发
      <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"/>  
      

  2.   

    好像不可以你在index的首页里面重定向到xxx.do
    既可以了
      

  3.   

    index.html 里指定有以下code 
    <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页面的方法?
      

  4.   

      <welcome-file-list> 
        <welcome-file>dispTop.do </welcome-file> 
      </welcome-file-list>
    这种写法是不行的 
      

  5.   

    那么有什么其他方法可以不通过index.html???
      

  6.   

    只有像1lou这样,到请求后再转向
      

  7.   

    很简单
    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>
      

  8.   

    问题解决了,感谢各位给出的方法~
    大家给的方法都没错,但是不是我想要得,我就是想在welcomefile里直接写.do的方式。
    现将我调试成功的方法贴出来,给大家参考。
    这是web.xml的设定,struts.config的设定没变
    <welcome-file>dispTop.do</welcome-file>
    之后,我在项目根目录建立了一个名字为dispTop.do的空文件。
    这样我的默认欢迎访问页面就是dispTop的action执行后的页面了。
    还是感谢各位,结贴去了,分就给前面几位了,谢谢。