• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Create Simple Web Server

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create my own simple embedded server - so that my web application would be portable.

Spring Boot or tomcat needs lot of libraries.

However wanted a simple embedded webserver which just can be used for my need. I don't even need tomcat...My web application would be standalone, but have search and few request to be served from the user.

Please advise on how we can create a own embedded server in few steps
 
Saloon Keeper
Posts: 2754
359
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How simple are your requirements?

NanoHTTPD is very lightweight.  I posted an example of a minimal RESTful server here.
 
Saloon Keeper
Posts: 5868
147
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

... tomcat needs lot of libraries.


Are you concerned about memory usage? PC hard drives have plenty of it these days (and Tomcat is not that big), so I wouldn't make that a primary concern.

I don't even need tomcat


What does this mean? Is it a Java web app, or not? You mention search, so there is an active server-side part to it? That would mean that an HTTP-only server (w/o servlet support) would be insufficient.

Please advise on how we can create a own embedded server in few steps


Embedding Tomcat is pretty easy, and you'll find lots of tutorials for it, like https://www.codejava.net/servers/tomcat/how-to-embed-tomcat-server-into-java-web-applications
 
Saloon Keeper
Posts: 21248
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neither Spring Boot nor Tomcat require "lots of libraries" if by that you mean system libraries (DLLs). It's the Java Virtual Machine that may need additional installations.

On the other hand, if you mean Java libraries, that depends on the webapp, not on Tomcat. Tomcat itself is ready-to-run when you unzip it. The essential libraries are already part of Tomcat. And given that, you can create simple servlet/jsp webapps with no extra libraries at all. It's just that since Java is an "expensive" language to develop for, many webapps are very complicated, and to keep them from being too much work, people use support libraries to simplify the job of creating and maintaining those webapps.

 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!