I have a Spring Integration application which needs to be relatively resource efficient. I want to expose a restful web service bound to localhost on a port > 1024. Right now the application is running from the command line as java -jar MyApp.jar
Is there a way of hosting the webservice without firing up an application container like Tomcat?
Update In the spring app is a gateway in it that I want to expose as a webservice.
Yes it is possible. Instead of packaging your application as a WAR and deploy it in a Servlet Container, your Main Class application may start and configure a Servlet stack by its own.
Here are tutorials on how to embed and start Jetty from your Spring application:
The following article describes it in details too.
For restful service, you just follow this documentation.