在myeclipse上部署了一个Athena3项目,web root-folder为/WebRoot,Web context-root为/athena。部署成功后输入http://localhost:8080/athena/index/index.htm能显示首页,但我找不到这个路径的文件。不知道这个路径是怎样转换到首页的,希望牛人能解答下!  

解决方案 »

  1.   

    tomcat webapp-athena-index-index.html如果找不到
    查看web.xml里配置文件,有没有
    <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
      

  2.   

    我不是牛人,希望能答你的问题。在web.xml那有一个
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
                    <welcome-file>index.htm</welcome-file>
                    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
      

  3.   

    这个肯定是在web.xml里面配置的
      

  4.   

    下面是web.xml的代码。不知道哪里是?<?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


    <!-- context-param 元素用来设定web站台的环境参数(context),它包含两个子元素:
    param-name和param-value.<param-name>参数名称</param-name>设定Context名称
    <param-value>值</param-value>设定Context名称的值 -->
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:spring*.xml</param-value>
    </context-param> <context-param>
    <param-name>error</param-name>
    <param-value>/commons/error.jsp</param-value>
    </context-param> <!-- 用于初始化Spring容器的Listener -->
    <!-- 利用ContextLoaderListenter来加载dao、service级别的context,而对于struts的action,用ContextLoaderPlugIn加载。 -->
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
        <!--系统初始化 --> <listener>
    <listener-class>com.hongwei.athena.web.listener.InitSystemListener</listener-class>
    </listener>
    <!-- openSession的作用在于在jsp显示之后再 关闭session-->
    <filter>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <filter-class>
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    <!-- singleSession默认为true,若设为false则等于没用OpenSessionInView ,还有一种是prototype-->
    <init-param>
    <param-name>singleSession</param-name>
    <param-value>true</param-value>
    </init-param>
    </filter> <filter-mapping>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <url-pattern>*.htm</url-pattern>
    </filter-mapping> <!-- 用于生成IMG的servlet -->
    <servlet>
    <servlet-name>img</servlet-name>
    <servlet-class>com.framework.commons.utils.AuthImage</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>img</servlet-name>
    <url-pattern>/img</url-pattern>
    </servlet-mapping> <!-- 配置Struts2的CleanUp的过滤器 -->
    <filter>
    <filter-name>struts2-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2-cleanup</filter-name>
    <url-pattern>*.htm</url-pattern>
    </filter-mapping>
    <!-- 配置装饰器sitemesh -->

        <filter>
    <filter-name>sitemesh</filter-name>
    <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
     
     
    <!-- 配置Struts2核心过滤-->
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>*.htm</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <!--  Character Encoding filter -->
    <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param> 
    </filter> 

    <error-page>
    <error-code>500</error-code>
    <location>/WEB-INF/jsp/error/error.jsp</location>
    </error-page>
    <error-page>
    <error-code>404</error-code>
    <location>/WEB-INF/jsp/error/error.jsp</location>
    </error-page>
    <error-page>
    <error-code>403</error-code>
    <location>/WEB-INF/jsp/error/error.jsp</location>
    </error-page>
    <servlet>
    <servlet-name>JSPSupportServlet</servlet-name>
    <servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    </web-app>