Where are servlets used today ?
I know that servlets are modules that run inside request/response-oriented servers, such as Java-enabled web servers. But now i don't hear anyone working with servlets.It may be that 'I' don't have people around who are much interested in servlets. But the thing is where servlets are used can't we write scripts in PHP
or program in asp
for that part ?
When i came to know that JDK'S IO classes can only work with system files,i thought of writting the particular application in php but because i love java i gave a look at servlet
.
My knowledge of servlets is not much,but because i needed some application on server that could generate a response when a button is clicked from my applet i came across servlet
. But then i thought is there anything that only servlets can do ?
So,is it worth learning to write servlet (or should i do in php/asp) when my goal is to write on a remote server file ?
UPDATE
This question is open to more 'fine` answers.None of the answer has actually answered the question
In the web (client-server) environment, a typical requirement is that browser submits some data to the server and server executes some code to fulfill the request. Most of the web technologies provide some way or the other to achieve this. Servlets is the Java way to do this. I believe there isn't anything which a Servlet can do and a PHP/ASP cannot do. Its the matter of choice of platform. If your platform is Java you use Servlet (explicitly or implicitly) or else you use ASP (MS platform), PHP (LAMP).
And this is not the end, whether you use Servlet/PHP/ASP depends on lot many other factors such as
To answer your specific question, I am not aware if any use case wherein only Servlets can do but at the same time I am limited by my experience. I would be curious to know of such a use case exist.
Whether you should learn Java is really dependent upon precisely what you want to do. I use Java when I am writing larger more complex systems. I prefer the more rigid structure of Java. I use PHP for quick scripts in Drupal.
You may prefer to do everything in PHP, there is no real reason not to if that is your preference.
A similar question was asked a year ago. A lot of the answers apply. https://softwareengineering.stackexchange.com/questions/17053/what-is-java-used-for-these-days
Servlets are used as internal components inside higher level frameworks. I use Wicket currently, and I've used Spring MVC. There's a long list in Wikipedia. You don't hear of many people working with Servlets because Servlets are a low level API, and it's generally more productive to use a higher level API and concentrate on the application.