管理面板中的错误:无法加载资源:服务器响应状态为404(未找到)

时间:2016-02-08 14:53:56

标签: javascript css hibernate spring-mvc bower

我正在使用Spring MVC 4.1.6.RELEASE创建简单的管理面板。

我遇到问题 - 无法加载资源:服务器响应状态为404(未找到)。我不明白。哪里错了?

picture index.jsp

我有以下文件。 结构文件网:

  • 资产

    - bower_components

    - css

    - js

    - image

  • WEB-INF

    - applicationContext.xml

    - dispatcher_servlet.xml

    - index.jsp

的index.jsp

        // Creating the topic if it does not exist already using the service bus connection string stored in the app.config file
        string connectionString =
            CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
        //appSettings dans appsettings getSettings()

        //connection au service bus
        var namespaceManager =
            NamespaceManager.CreateFromConnectionString(connectionString);
        //verification  si queue existe

        if (!namespaceManager.QueueExists("CommentaireQueue"))
        {
            namespaceManager.CreateQueue("CommentaireQueue");
        }


        QueueClient client = QueueClient.Create("CommentaireQueue");
        Console.WriteLine("test console");
        //boucle infini pour recevoir tous les messages
        while (true)
        {
            var message = client.Receive();
            if (message != null)
            {
                var comm = message.GetBody<string>();
                string myString = comm.Contenu;
                try
                {


                        Console.WriteLine(myString);

                }
                finally
                {
                    //enlever le message de la queue
                    message.Complete();
                }
            }
        }

    }

调度-servlet.xml中

<head>
    <title>Registration Page</title>
<link href="assets/css/style.css" rel="stylesheet">
<script src="assets/bower_components/angularjs/angular.js" type="application/javascript"></script>
<script src="assets/bower_components/jquery/jquery.js" type="application/javascript"></script>
<script src="assets/bower_components/bootstrap/dist/js/bootstrap.js" type="application/javascript"></script>
<script src="assets/bower_components/bootstrap/dist/js/bootstrap.min.js" type="application/javascript"></script>
<link href="assets/bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet"/>
<link href="assets/bower_components/bootstrap/dist/css/bootstrap-theme.css" rel="stylesheet"/>
<link href="assets/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="assets/bower_components/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet"/>
<script src="assets/bower_components/bootbox/boot.js" type="application/javascript"></script>
<script src="assets/bower_components/bootbox/bootbox.js" type="application/javascript"></script>
<script src="assets/bower_components/bootbox/bootbox.min.js" type="application/javascript"></script>
</head>

的web.xml

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

    <context:component-scan base-package="com"/>
    <mvc:resources location="/assets/" mapping="/assets/**"/>
    <mvc:default-servlet-handler/>
    <mvc:annotation-driven/>
    <bean id="jspViewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass"
                  value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix" value="/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

    <bean id="mySessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="configLocation" value="classpath*:hibernate.cfg.xml"/>
    </bean>

</beans>

hibenate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">
    <display-name>SpringExamples</display-name>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

0 个答案:

没有答案