I have an war file with runs under tomcat i need to make it as an desktop application and most of them recommend to embedded an jetty server as an desktop application can any one explain how to do it with an example. I am little confused how to do it or some tutorials that embedded jetty server as desktop application.
Asked
Active
Viewed 2,669 times
2 Answers
4
These are your options:
- Embed Jetty in your WAR file
- Use Winstone within your WAR file - similar to above
- Embed Jetty in your app - tutorial here and here

Łukasz Rżanek
- 5,786
- 27
- 37
1
Embedding Jetty is really simple if you dare to try it. At first glance, web servers are mysterious beasts but they are really just "simple" Java applications which open a server socket and listen to HTTP requests. Just create an instance of Server
and start()
it.
That will create a couple of new threads in which Jetty will handle requests. Your main thread is free to whatever else it wants to do. To stop it, call stop()
and join()
.

Aaron Digulla
- 321,842
- 108
- 597
- 820