【问题标题】:Angular js with spring mvc带有spring mvc的Angular js
【发布时间】:2013-06-19 04:40:47
【问题描述】:

目前正在尝试用spring mvc实现angular js

尝试从站点-https://github.com/xvitcoder/spring-mvc-angularjs实现示例项目springmvc-angularjs-master,不知道如何将此示例项目的文件夹结构使用到spring项目中。

我读了帖子 - Spring MVC and Angularjs 但仍然找不到解决方案。我需要在 web 应用程序的 src 文件夹下新建文件夹 webapp 吗?

谁能帮我把这个示例项目转换成 Spring Web 应用程序? 我没有使用 maven,而是在 myeclipse ide 中使用带有 spring 功能的简单 Web 应用程序。

当前项目文件夹结构:

示例应用

-src

  --controller,bean folders

-webroot

 --webinf
     ---web.xml,springmvc.xml
     ---html folder(index.html,etc.,)
 --resources
     ---js
         ----app.js,services.js,controller.js and lib folder

【问题讨论】:

    标签: angularjs


    【解决方案1】:

    您应该能够将项目作为 Maven 项目导入(导入 > Maven > 现有 MavenProject)并按原样运行。所有必要的映射都可以在 /src/main/webapp/WEB-INF/spring/webapp-config.xml 中找到

    一旦你明白了这一点,你应该能够提取你需要的东西。

    我还注意到一些@override 注释抛出了一些错误。我刚刚删除了它们。

    【讨论】:

    • Thanks.followed the steps as described but could not figure out the problem。因此尝试了一种新方法 - 后端使用带有杰克逊的 spring mvc restful 和带有角度 js 种子项目的前端。使用链接-“mkyong.com/webservices/jax-rs/json-example-with-jersey-jackson”创建了restful应用程序,它通过点击演示中提到的url来工作,但是在与angular js集成时它不起作用。我不知道如何继续,因为我弄乱了代码。你能提供一些使用带有spring mvc的angular js的链接吗?
    • 当然。给我几个小时。
    • 你在使用 Spring Tool Suite 吗?
    • 我尝试从 Angular 类的 services.js 调用请求映射...请求本身未处理..实际上我需要在链接“github.com/teunh/jfall2012”中创建类似的内容,但请求自己不去..
    • 尝试运行这个例子:codetutr.com/2013/04/09/…
    猜你喜欢
    • 2017-10-04
    • 1970-01-01
    • 1970-01-01
    • 2016-04-22
    • 2017-07-21
    • 1970-01-01
    • 2015-09-25
    • 1970-01-01
    • 2017-10-08
    相关资源
    最近更新 更多