Java Servlets Question and Answers

9. What are the uses of Servlets?
 
  • Servlets are used to process the client request.
  • A Servlet can handle multiple requests concurrently and be used to develop high performance system.
  • A servlet can be used to load balance among several servers, as servlet can easily forward requests.
 
Your Name Your Email-ID
Your Answer
10. What are the differences between Servlets and Applets?
 
  • Servlets are server side components that runs on the Servlet container.
  • Applets are client components and run on the web browsers.
  • Servlets have no GUI interface.
 
Your Name Your Email-ID
Your Answer
11. What are the different ways we can maintain state between requests?
  Following are the different ways of maintaining states between stateless requests
  • URL rewriting
  • Cookies
  • Hidden fields
  • Sessions
 
Your Name Your Email-ID
Your Answer
12. What is the difference between authentication and authorization?
 
  • Authentication is the process the application identifies that you are who.
  • For example when a user logs into an application with a username and password, application checks that the entered credentials against its user data store and responds with success or failure.
  • Authorization, on the other hand, is when the application checks to see if you are allowed to do something. For instance are you allowed to do delete or modify a resource.
 
Your Name Your Email-ID
Your Answer
1234567891011 Page 3 of 11