Java ecosystem is packed with frameworks and libraries.
For sure not as many as in JavaScript world and they don't get old as quickly too but st...
For further actions, you may consider blocking this person and/or reporting abuse
I'm writing a Java blog that doesn't use a framework and all of the code is available on github. I do use Undertow as the web server which gives me a lot of the HTTP parts. stubbornjava.com/
Thanks Bill, I'll have a look.
Thank you. I am looking for a way to implement REST API without Spring involved so Kubernetes can check my liveness probe, and your post work perfectly.
Can I use an xml file instead of "hello"?
Can you explain what you mean exactly?
I have a generated XML data file. I want it to be available in Endpoint instead of "hello".
In conclusion, I want to type localhost: 8080 / XML and see the data from the XML file I have in the folder.
Instead of hardcoded text just read the file content as bytes. The rest is the same.
I'm sure you can google out plenty of examples like this one:
Then :
Haven't checked it compiles but give it a try.
it's very nice
Thank you.
You can simplify this even further by simply using a servlet which handles much of what you have coded in your example.
Probably, but I would not like to develop my own servlet container from scratch when we have plenty of them already. I would use Tomcat or Jetty or other if I went this route. The purpose was to make sth simple from ground up, but the experiment shows it's not that simple after all when the API grows, cause eventually we would come up with reinventing a wheel. My feelings, weather to use it in real app, or stick to well known frameworks like Spring are mixed. Still, I think it's good to know underlying techniques that the frameworks base on.
Super useful article, thanks!
Hi, thanks. Let me know if you find some parts of it applicable in production ready app. I'm curious.