无法加载extjs4文件

时间:2013-04-28 20:26:05

标签: spring-mvc extjs4

我正在使用extjs4和spring mvc(Java EE)。

当我运行项目时,我在浏览器上看不到任何内容。

我在servlet调度程序中添加了这段代码:

 <mvc:annotation-driven />
 <mvc:resources mapping="/resources/**" location="/resources/" />

当我运行它时,显示错误:

28 avr. 2013 21:15:30 org.springframework.web.servlet.DispatcherServlet noHandlerFound
ATTENTION: No mapping found for HTTP request with URI [/CR/application/view/Viewport.js] 
in DispatcherServlet       with name 'mvc-dispatcher'
28 avr. 2013 21:15:30 org.springframework.web.servlet.DispatcherServlet noHandlerFound
ATTENTION: No mapping found for HTTP request with URI [/CR/Ext4Example/view/login/LoginForm.js] 
in    DispatcherServlet with name 'mvc-dispatcher'

Ext4Example是我的extjs应用程序的名称 这是我的app.js

Ext.Loader.setConfig({enabled: true});

Ext.application({
name: 'Ext4Example',
appFolder: 'application',

controllers: [
   'Login'
],
autoCreateViewport: true
});

和我的index.jsp页面

<!DOCTYPE html>
<html >
<head>

<!-- Ext JS Files -->
 <link rel="stylesheet" href="./resources/ext-4.0/resources/css/ext-all.css"/>
 <link rel="stylesheet" href="./resources//css/main.css"/>
 <script src="./resources/ext-4.0/ext-all.js"></script>



 <!-- App Files -->
 <script type="text/javascript" src="./resources/application/app.js"></script>
   <script type="text/javascript" src="./resources/application/view/Viewport.js"></script>
   <script type="text/javascript" src="./resources/application/view/login/CenterPanel.js"></script>
    <script type="text/javascript" src="./resources/application/view/login/create-rd.js"></script>
     <script type="text/javascript" src="./resources/application/view/login/HomePage.js"></script>
      <script type="text/javascript" src="./resources/application/view/login/LoginForm.js"></script>
       <script type="text/javascript" src="./resources/application/view/login/WestMenu.js"></script>
      <script type="text/javascript" src="./resources/application/controller/Login.js"></script>
      <script type="text/javascript" src="./resources/application/model/Login.js"></script>
      <script type="text/javascript" src="./resources/application/store/Login.js"></script>



</head>
<body background="./resources/images/gray.jpg">

</body>
</html>

任何人都可以向我解释错误吗?

当我单击Ctrl + U并单击文件URL时,我可以看到代码源。

1 个答案:

答案 0 :(得分:0)

如果使用弹簧标签怎么办?这样的事情:

<spring:url value="/resources/application/view/Viewport.js" var="some_url"/>
<script type="text/javascript" src="${some_url}"></script>