1

I am trying to do some performance and functionality evaluation of tomcat vs jetty with spark-java web framework,I am looking for an example of adding tomcat as an embedded web-server.

mohan08p
  • 5,002
  • 1
  • 28
  • 36
Fritz Seitz
  • 63
  • 2
  • 7

1 Answers1

0

Sparkjava actually is an implementation, it wraps Jetty in order to be able to do it's work. I think it's not possible to embed Tomcat in Sparkjava, but the documentation has instructions on how to integrate Sparkjava in a pure java Web project structure (where one of the options is Tomcat). Even if you do this my bet is that Jetty will still be the engine under the hood.

Laercio Metzner
  • 1,351
  • 11
  • 22
  • Yes, I have seen that and to quote the documentation, "To run Spark on another web server (instead of the embedded jetty server)". I would like to see an example of this. – Fritz Seitz Feb 12 '18 at 22:29
  • There is clear documentation for embedded Tomcat, so it is possible. It isn't being *embeded in* Sparkjava. Sparkjava doesn't do much with the server, it will simply get it's request and response objects from a different web server. Because of how jetty isn't well exposed doing it the way the OP wants will allow for greater customisation. – Quaternion Mar 02 '18 at 23:50
  • Here is example of someone doing similar: https://stackoverflow.com/questions/19783646/how-to-deploy-a-spark-java-web-app – Quaternion Mar 02 '18 at 23:52
  • I was looking from the perspective if it is possible to swap out jetty with another embedded server, in this case tomcat if possible. And not using the war deploy method. Just a straight out swap. – Fritz Seitz Mar 03 '18 at 14:33