0

该项目是zk springmvc集成

我有问题,我无法加载 ZUL 页面,我不知道问题出在哪里!

我收到错误 HTTP 状态 404“请求的资源不可用”

在我的代码下面..

小服务程序.xml

<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:tx="http://www.springframework.org/schema/tx" 
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:mvc="http://www.springframework.org/schema/mvc"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
 http://www.springframework.org/schema/mvc
 http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-3.1.xsd
 http://www.springframework.org/schema/aop 
 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
 http://www.springframework.org/schema/tx 
 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

 <context:annotation-config />
 <mvc:annotation-driven /> 
 <context:component-scan base-package="Controllers"/>
 <context:component-scan base-package="Models"/>

 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/JSP/" />
    <property name="suffix" value=".jsp" />
    <property name="order" value="1" />
 </bean>


<bean id="viewResolver"     
      class="org.zkoss.spring.web.servlet.view.ZkResourceViewResolver">
     <property name="prefix" value="/WEB-INF/ZUL/" /> 
     <property name="suffix" value=".zul" /> 
     <property name="order" value="2" />
</bean>



<bean id="dataSource"   
   class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName"   
                value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
       <property name="url" value="jdbc:sqlserver://127.0.0.1:1433; 
                 DatabaseName=AECMDMS_TEST"/>
       <property name="username" value="hassan"/>
       <property name ="password" value="123" />

</bean>

<bean id="sessionFactory"       
      class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />

    <property name="configLocation">
        <value>/META-INF/hibernate.cfg.xml</value>
    </property>

    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect"> 
                 org.hibernate.dialect.SQLServer2008Dialect</prop>
            <prop key="hibernate.show_sql">true</prop>
        </props>
    </property>
 </bean>

 <bean id="transactionManager"   
       class="org.springframework.orm.hibernate4.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory" />
 </bean>

 <tx:annotation-driven />

</beans>

web.xml

<web-app id="WebApp_ID" 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">
 <display-name>FEP_Health</display-name>

    <!-- Spring MVC  -->

<servlet>
  <servlet-name>FEP_Health_System</servlet-name>
  <servlet-class>
     org.springframework.web.servlet.DispatcherServlet
  </servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>FEP_Health_System</servlet-name>
  <url-pattern>/</url-pattern>
</servlet-mapping>



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

   <param-value>
      /WEB-INF/FEP_Health_System-servlet.xml
   </param-value>
</context-param>
<listener>
  <listener-class>
    org.springframework.web.context.ContextLoaderListener
  </listener-class>
</listener>


                     <!-- ZK -->

    <listener>
            <description>ZK listener for session cleanup</description>
            <listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
    </listener>

    <servlet>
            <description>ZK loader for ZUML pages</description>
            <servlet-name>zkLoader</servlet-name>
            <servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
            <init-param>
                    <param-name>update-uri</param-name>
                    <param-value>/zkau</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
            <servlet-name>zkLoader</servlet-name>
            <url-pattern>*.zul</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
            <servlet-name>zkLoader</servlet-name>
            <url-pattern>*.zhtml</url-pattern>
    </servlet-mapping>

    <servlet>
            <description>The asynchronous update engine for ZK</description>
            <servlet-name>auEngine</servlet-name>
            <servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
    </servlet>

    <servlet-mapping>
            <servlet-name>auEngine</servlet-name>
            <url-pattern>/zkau/*</url-pattern>
    </servlet-mapping>

    <session-config>
            <session-timeout>60</session-timeout>
    </session-config>

</web-app> 

fepEnergyData.zul

<?page title="FEP Energy Data Monitoring" contentType="text/html;charset=UTF-8"?>
  <zk>
    <window title="FEP Energy Data Monitoring" border="normal">


    </window>



</zk>
4

0 回答 0