| CGI | Servlet | |
|---|---|---|
| Language | Perl (typically) | Java |
| Per request | Separate Process | Lightweight Thread |
| Resource use | ❌ High (heavy) | ✅ Low (efficient) |
| Scalability | ❌ Poor | ✅ Excellent |
| Feature | GET | POST |
|---|---|---|
| Purpose | Retrieve data | Send data for processing |
| Data location | Appended to URL | Inside request body |
| Data size | ❌ Limited | ✅ Unlimited |
| Security | ❌ Visible in address bar | ✅ Hidden |
| Bookmarkable | ✅ Yes | ❌ No |
| Use cases | Search, fetching pages | Passwords, uploads, forms |
https://site.com/search?name=value&name2=value2? is the query string — fully visible to anyone.
200 OK / 404 Not Found