2013-04-28 43 views
1

我使用的是extjs4和spring mvc(Java EE)。extjs4文件不能被加載

當我運行項目時我在瀏覽器上看不到任何東西。

我添加此代碼對我的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時,我可以看到代碼源。

回答

0

而如果你使用spring標籤呢?類似的東西: <%@標籤庫URI = 「http://java.sun.com/jsp/jstl/core」 前綴= 「C」 %> <:

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

我通過使用該修復它script type ='text/javascript'src =''> – Amin 2013-05-03 14:33:04