Currently I´m trying to learn Angular JS
, but firstly I want to setup my environment with 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
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?
I tried to put in src/webapp/resources/app
but then I have to move the html
files to WEB-INF?
How was your skeleton in your angular-js spring mvc applications?
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
?
Thanks!
As far as I can understand, your Front End technology is Angualar JS and your Back End technology is Spring MVC.
I'm a Front End developer and hence I can provide you the advice on the structure of your HTML, CSS, and Javascript.
Here are my recommendations:
Mode Of Communication Between Front End and Back End: JSON (Should be strictly followed for MVC Pattern)
File Location: All your Front End files should be in WEB-INF folder with this structure:
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
: 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
: All the static resources that would be injected into the JSPs using <ng-view>
or <ng-include>
can be placed here
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With