0

I have spring MVC web app, That is run on web browser. But now I want to use this application as standalone software. So any trick to convert this spring MVC application from web application to standalone software.

Abhishek Rana
  • 107
  • 2
  • 14
  • Have you looked into Spring boot executable jar? – Nikhil Dec 21 '18 at 04:22
  • No, u have any idea to convert spring mvc into spring boot? If i change spring mvc pom into spring boot pom then all other spring mvc code will work finely ? – Abhishek Rana Dec 21 '18 at 04:37
  • I would recommend starting a small project with spring boot and then copy-pasting the code where you see fit. It should be easy with the Spring Tool Suite (STS). – Nikhil Dec 21 '18 at 04:51
  • What do you mean with standalone software? If you want to run the same code as is on a standalone machine then it is pretty easy migrate it to a Spring Boot application and it will be executable and accessible through a browser, your code can mostly remain the same. If you mean a desktop application with a specialized GUI then you would need to rebuild parts of your application. – M. Deinum Dec 21 '18 at 07:50
  • @M.Deinum I want web app that will run on one click and without need to start tomcat. If I convert spring mvc to boot then what's the main steps. I am trying to convert but application will not run. Check my different question to migrating [link](https://stackoverflow.com/questions/53929619/trying-to-migrate-from-spring-mvc-to-spring-boot/53929841#53929841) . – Abhishek Rana Dec 26 '18 at 09:15
  • Why won't you start Tomcat? Why should that matter. – M. Deinum Dec 28 '18 at 14:37
  • Because i want to run application just one click. – Abhishek Rana Dec 29 '18 at 05:06

2 Answers2

0

Electron window server allows you to host external site. You can create a standalone software that points to your Spring MVC web URL from electron windows server. Alternatively, you can also separate your front and back end code as electron bundles html/js in desktop application. Your front end will then communicate with your backend via REST APIs.

mkjh
  • 1,634
  • 13
  • 25
  • Thanks for reply ...using this I also need to tomcat server.can I use this software without using tomcat server. Any solution for this. – Abhishek Rana Dec 21 '18 at 03:12
0

As I understand, there is no qucker way . You have to convert mvc configuration to standalone web application step by step. Mvc rest mapping can be converted to REST api using library like Resteasy. Veiw mapping from spring MVC can be done through web.xml of standalone application. It will helpful, if you provide more details regarding exactly what you want to achieve.