DEV Community

Shubhangi
Shubhangi

Posted on

⚰️Spring Boot Postmortem#3

Java vs The Web ⚔️

Java Knows Everything.

Except Websites.

Don’t get me wrong , Java is amazing ⭐

It understands :

Classes
Objects
Inheritance
Collections
Threads.

And a lot of other things.

Ask Java to print Hello World? Done.

Ask Java to calculate Fibonacci? Done.

BUT....

Ask Java GET /products ?

Java: bro…what even is a GET?

And that’s NOT java being lazy.

Core Java simply wasn’t designed to understand web concepts like HTTP requests, URLs, headers, cookies, sessions, or REST APIs on its own.

So what if we built a website using only Java?

Prepare to suffer ☠️

You’d have to:

-Open a network port.
-Read raw bytes.
-Figure out where the HTTP headers end.
-Parse the request yourself.
-Decide which method to call.
-Create the response manually.
-Handle multiple users.
-Manage threads.

All Alone.

Imagine being hired to build an e-commerce website…and spending half your time translating internet messages instead of writing business logic.

That manual work is exactly what every Java web app would otherwise repeat.

Someone (with brains) eventually got tired of doing this.

They built something revolutionary.

Drumrolls please 🥁

They’re called Servlets.

To know more about it , checkout my next article. Go run.🏃‍➡️

Top comments (0)