Spring MVC和Angularjs [英] Spring MVC and Angularjs
问题描述
目前我正尝试学习角JS
,但首先我想设置我的环境Spring MVC的
。
Currently I´m trying to learn Angular JS
, but firstly I want to setup my environment with Spring mvc
.
目前,我只想休息的工作,但我对什么是放置在 Spring MVC的
At the moment I only want to work with rest, but I have a doubt for what is the best way to place the resoucres in Spring MVC
我的简单applicaction有这个squeleton:
My simple applicaction has this squeleton:
my-simple-app:
src
main
java
resources
webapp
resources
WEB-INF
如果我想把应用
文件夹从的角种子,是什么把它最好的地方?
If I want to put the app
folder from the angular-seed, what is the best place to put it?
我试图把在的src / web应用/资源/应用
但我必须移动 HTML
文件到WEB-INF?
I tried to put in src/webapp/resources/app
but then I have to move the html
files to WEB-INF?
您如何评价您的角的js Spring MVC应用框架?
How was your skeleton in your angular-js spring mvc applications?
什么是做重定向到的最佳方式应用程序/ index.html的
?到欢迎文件,然后只与 angularjs
$ routeproviders
?
What is the best way to do the redirect to the app/index.html
? to the welcome file and then work only with angularjs
$routeproviders
?
谢谢!
推荐答案
据我可以理解,你的前端技术的 Angualar JS 的和你的后端技术的 Spring MVC的。
As far as I can understand, your Front End technology is Angualar JS and your Back End technology is Spring MVC.
我是一个前端开发人员,所以我可以在结构的HTML,CSS和Javascript。
I'm a Front End developer and hence I can provide you the advice on the structure of your HTML, CSS, and Javascript.
下面是我的建议:
-
模式前端和后端之间的通信:JSON(应严格遵循MVC模式)
Mode Of Communication Between Front End and Back End: JSON (Should be strictly followed for MVC Pattern)
文件位置:您所有的前端的文件应该是WEB-INF文件夹与此结构:
File Location: All your Front End files should be in WEB-INF folder with this structure:
-
WEB-INF /资产
:您所有的JavaScript文件,JavaScript库,图片,CSS等应的地方在这里。你可以打开一个单独的文件夹中的每个资源类型中资产
WEB-INF/Assets
: All your JavaScript Files, JavaScript Libraries, Images, CSS etc. Should Be Places Here. You Can Open A Separate Folder Each Resource Type Inside Assets
WEB-INF / JSP
:您的所有的JSP应该放在这里。由于角最大的优势是单页应用程序,可以为每个主要的第一页JSP并在这里把它们
WEB-INF/JSP
: All Your JSPs should be placed here. As Angular's greatest strength is Single page Application, you can create one JSP per main page and place them here
WEB-INF / HTML
:所有这一切将通过注入JSP的静态资源< NG-视图>
或< NG-包括>
可以放在这里
WEB-INF/HTML
: All the static resources that would be injected into the JSPs using <ng-view>
or <ng-include>
can be placed here
希望这有助于!
这篇关于Spring MVC和Angularjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!