angularjs - Spring MVC and Web Application separated -
i have been googling lot lately, find myself coming short on answers.
i have complete spring mvc application secured spring security , services exposing logic controllers (controllers -> service -> repository -> pojo's).
currently controllers, except login controller, serve nothing json/xml , want stay way. not want render different views on each controller.
however, want able to, separate web application backend because in time want able integration service using more platforms web browser.
currently have regular spring mvc application:
- configuration
- domain(pojo's)
- repository
- service
- controller
login done using thymeleaf rendered view , spring security nothing more filtering urls under application root. after this, bunch of static files being served resources:
spring controllers send "{ontrollername}/layout" serve angularjs html partial used data under given spring controller.
what want, way separate in /webapp directory rest of project. have looked few different solutions here such using apache proxy apache http server hosts client code communicate backend using ajax rest controllers, , tomcat hosting backend. however, hear proxying not safe. dead wrong here.
so, questions hope receive answers are: 1. fine write client uses apache http server's proxy provide access ajax on server?
if not; how should proceed? point in trying extract client side /webapp directory or stupid idea created because seemed cool able deploy them without having relay on each others?
is there best practices in regards how structure project separate modules? think gradle build scripts multi modules.
should think in different terms , use approach not based on spring mvc @ all? if so, please advice me.
i hope clear enough make sense guys.
the solution use simpler approach of restful api did authentication on oauth 2.
basically 2 best alternatives hybrid solution (part restful api , part server side rendering of pages) or full blown restful api implement functionality in static web client. way there no need multi-module projects , packing things in 1 package.
Comments
Post a Comment