1

I have a Java desktop application which uses spring framework and I need to replace the Swing UI with a web front end. I understand that I will need to adapt many things to make things work with the MVC architecture. My concrete question is the following:

Will my application now have to run entirely in the application server?

I would appreciate if anyone could point me to some documentation that goes through a similar process.

Thanks!

DiegoSahagun
  • 730
  • 1
  • 11
  • 22
  • Unless the application communicates (with sockets, RMI, web services or whatever) with another application, then yes, Spring MVC is servlet-based, and needs a servlet container to run. – JB Nizet Feb 04 '15 at 17:06
  • My application does communicate with android clients using MQTT, would that represent a problem? – DiegoSahagun Feb 04 '15 at 21:59
  • When you say _web front end_, do you mean that the application no longer runs on the desktop? – a better oliver Feb 05 '15 at 11:08
  • What I mean when I say "web front end" is to make the GUI accessible using a web browser so we can interact remotely with the application without the need of Remote Desktop, for example. I am not sure if that implies that the entire application will no longer run as a desktop application or not. – DiegoSahagun Feb 05 '15 at 12:58

1 Answers1

1

Technically yes, but Spring Boot makes it trivial to set up an embedded servlet container and package your entire application as a runnable jar. This is how we're deploying our applications to production; the only thing we need is a JRE on the server VM, and java -jar takes care of all of it.

I recommend using Maven with the Spring Boot plugin (there's also a Gradle plugin) with the repackage goal, and using the lightweight Undertow servlet engine instead of the default Tomcat.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
  • Thanks, this is a good approach. I only had problems with multiple slf4j bindings since I was already using it but works now quite well. – DiegoSahagun Feb 06 '15 at 17:44