0

I have implemented an API that is REST based using SparkJava (http://sparkjava.com). Its a standalone app and works great.

Now I'd like to implement part of that functionality access through a Vaadin UI. I'm quite new to Vaadin as well.

Does anyone know how I can still keep the single VM model, and able to use Vaadin's wonderful UI structures with greatness of SparkJava?

Is there someway that I can bind the Vaadin Servlet to the SparkJava Route perhaps?? Just thinking loud here.

Appreciate your help very much!!

I assume this is possible because I saw its used with Jetty (Vaadin 10/11 and embedded Jetty)

SydMK
  • 425
  • 4
  • 12

1 Answers1

2

sure that is possible! You can simply make Jetty expose both SparkJava filter, and Vaadin 10+ servlet. I've created an example application which builds on Alejandro's work: https://github.com/mvysny/embedded-jetty-demo

Martin Vysny
  • 3,088
  • 28
  • 39
  • Hi Martin, Now I'm trying to add Spark to the same solution. Would you know any answer to this at all: https://stackoverflow.com/questions/54835994/apache-shiro-with-embedded-jetty-or-spark-java-is-it-possible?noredirect=1#comment96511629_54835994 – SydMK Feb 26 '19 at 22:15