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!

4
  • 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. Commented Feb 4, 2015 at 17:06
  • My application does communicate with android clients using MQTT, would that represent a problem? Commented Feb 4, 2015 at 21:59
  • When you say web front end, do you mean that the application no longer runs on the desktop? Commented Feb 5, 2015 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. Commented Feb 5, 2015 at 12:58

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.