1

我正在使用 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 时,我可以看到代码源。

4

1 回答 1

0

如果你使用弹簧标签呢?类似的东西:

<spring:url value="/resources/application/view/Viewport.js" var="some_url"/>
<script type="text/javascript" src="${some_url}"></script>
于 2013-05-03T11:51:53.957 回答