我在tomcat上运行时无法显示页面

时间:2016-01-13 10:01:51

标签: java maven jsp tomcat

我有一个maven webapp项目,它生成一个.war文件。我在tomcat 6中部署了它,它显示:找不到ìndex.jsp的页面和login.jsp的白页。

并且在我的D:\

下的tomcat历史文件和文件log.xml中没有出现任何问题

我在IE和Firefox中尝试过。

欢迎提出一些建议。

修改

我的网络应用结构:

enter image description here

我的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" id="WebApp_ID">
<!--
  <web-app>
 -->
    <description>POSANet</description>
    <display-name>posanet2</display-name>

    <session-config>
        <session-timeout>10</session-timeout>
    </session-config>

    <!-- Context Parameters -->
    <context-param>
        <param-name>debug</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>

            classpath:applicationContext-acegi-security.xml
            classpath:applicationContext-ajax.xml
            classpath:applicationContext-service.xml
<!--            classpath:applicationContext-ws.xml-->
            classpath:applicationContext-common.xml
            classpath:applicationContext-datasSource.xml
            classpath:applicationContext-dao.xml
            classpath:applicationContext-notification.xml
            classpath:applicationContext-wsbscs.xml
<!--            classpath:applicationContext-jcaptcha.xml -->
<!--        classpath:applicationContext-mq.xml -->
        </param-value>
    </context-param>

    <!--            classpath:applicationContext-mq.xml
     -->


    <!-- log4j -->
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/classes/log4j.xml</param-value>
    </context-param>

    <context-param>
        <param-name>log4jRefreshInterval</param-name>
        <param-value>120000</param-value>
    </context-param>

    <!-- Le lien vers site -->
    <context-param>
        <param-name>com.application.sitePrefix</param-name>
        <param-value>http://www.application.com</param-value>
    </context-param>

    <!-- Log4j intialisation -->
    <listener>
        <listener-class>
            org.springframework.web.util.Log4jConfigListener
        </listener-class>
    </listener>

    <!-- Spring intialisation -->
    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>


    <listener>
        <listener-class>
            com.application.posanet.util.SessionListener
        </listener-class>
    </listener>


    <!-- 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>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>*.form</url-pattern>
    </filter-mapping>

    <!--  Expired Spring Web Flow Clean up Filter -->
    <filter>
        <filter-name>flowCleanup</filter-name>
        <filter-class>org.springframework.webflow.execution.servlet.ExpiredFlowCleanupFilter</filter-class>
        <init-param>
            <param-name>timeout</param-name>
            <param-value>20</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>flowCleanup</filter-name>
        <servlet-name>spring</servlet-name>
    </filter-mapping>

    <!-- Spring MVC Servlet -->
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.form</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.excel</url-pattern>
    </servlet-mapping>

    <!-- DWR -->
    <servlet>
        <servlet-name>dwr-invoker</servlet-name>
        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>dwr-invoker</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>

    <!-- Security -->
    <filter>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <filter-class>
            net.sf.acegisecurity.util.FilterToBeanProxy
        </filter-class>
        <init-param>
            <param-name>targetClass</param-name>
            <param-value>
                net.sf.acegisecurity.util.FilterChainProxy
            </param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <servlet-name>spring</servlet-name>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <url-pattern>/j_acegi_security_check</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <servlet-name>dwr-invoker</servlet-name>
    </filter-mapping>


    <listener>
        <listener-class>
            net.sf.acegisecurity.ui.session.HttpSessionEventPublisher
        </listener-class>
    </listener>

    <!-- Jsp config -->

    <jsp-config>
        <taglib>
            <taglib-uri>util-functions</taglib-uri>
            <taglib-location>/WEB-INF/classes/util-functions.tld</taglib-location>
        </taglib>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <page-encoding>UTF-8</page-encoding>
        </jsp-property-group>
    </jsp-config>

    <!-- Ressource -->

    <resource-ref>
        <description>Main Data Source</description>
        <res-ref-name>jdbc/posadb</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>

        <welcome-file>default.jsp</welcome-file>
        <welcome-file>default.htm</welcome-file>

    </welcome-file-list>

    <!-- Error pages -->
    <error-page>
        <error-code>400</error-code>
        <location>/WEB-INF/pages/message/notFound.jsp</location>
    </error-page>

    <error-page>
        <error-code>404</error-code>
        <location>/WEB-INF/pages/message/notFound.jsp</location>
    </error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/WEB-INF/pages/message/forbidden.jsp</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/WEB-INF/pages/message/internalError.jsp</location>
    </error-page>

    <error-page>
        <error-code>408</error-code>
        <location>/WEB-INF/pages/message/timeExceeded.jsp</location>
    </error-page>

</web-app>

结构目标: enter image description here

0 个答案:

没有答案