David Nimmagadda
David Nimmagadda

Reputation: 83

Spring Boot standalone app with inbuilt Tomcat server Vs building a war

My Application : backbone.js based frontend, RESTFUL webservices based backend. I have configured a spring boot standalone application for the above spec. I have used configured spring security for token based authentication. The static content too is bundled inside the jar and served by the embedded tomcat server.

My Question : I've previously seen project setups where front-end and backend are cleanly separated by having webserver - app server setup. Now here I am bound to put both of them inside a bundle. Separation Of Concerns? Or is it better to configure spring boot to create a war for me? I feel spring boot isn't meant for creating wars ..

Upvotes: 4

Views: 1395

Answers (2)

Simon
Simon

Reputation: 629

If you are using gradle as a build tool, you can simply use

apply plugin: 'war'

gradle war

to create a war

Upvotes: 1

Anurag
Anurag

Reputation: 21

You can change packaging from jar to war. But in jar packaging there is one limitation that you can't use JSP Servlets technology, while war support that. To deploy war you have to write descriptor file, war.xml and also you need a server to deploy war, while jar as you know Spring boot gives an inbuilt server. I hope my answer helped.

Upvotes: 1

Related Questions