Can you implement Vue.js in a Java EE web application?

15,862

Solution 1

Vue.js is a javascript front-end framework. There is nothing to stop you from using that with a middle-layer/back-end technology like Java EE. In your HTML pages(or JSP) just include the Vue.js file as mentioned in the documentation, and other .js files that you create as part of your vue.js frontend application.

The library can then interface with any HTTP-based backend methods that you expose (using Servlets, Controllers, etc.) depending on how your Java EE project is structured and what frameworks it uses.

Solution 2

While investigating the same question, I found this good blog that has a git repository too https://blog.codecentric.de/en/2018/04/spring-boot-vuejs/

From a glance it looks like a read solid implementation, however it has some sticky setup i haven't come across before. It dose however seem like a professional and scalable solution i will definitely give a try. https://github.com/jonashackt/spring-boot-vuejs Thankyou 04/24/18 by Jonas Hecht

Solution 3

For sure you can.

Your java application, which is your "backend", has to expose its functionalities as Web services (REST Json WS should be the easiest for what you are trying to do).

To expose your services as Web services, you need to find the easiest framework fitting your need. You will probably need to dive into Maven if you haven't yet, because these frameworks tend to have tons of dependencies.

Your Vue.js interface will make calls to the backend via HTTP requests each time necessary (get a resource, update a resource, ...).

Share:
15,862
IFreshman
Author by

IFreshman

Updated on June 16, 2022

Comments

  • IFreshman
    IFreshman about 2 years

    I just develop a tool with my classmates and we want to use Vue.js as Web interface.

    For Description what we programmed. We developed a Java EE web application in Eclipse. We use Tomcat 7 as web server. I search a long time and i found nothing.