Java Concurrency Interview Questions and Answers - 1

Question: 1

Which are the different ways you can communicate between servlets?

Below are the different ways of communicating between servlets:-

Using RequestDispatcher object.

Sharing resource using “ServletContext()” object.

Including response of the resource in the response of the servlet.

Servlet chaining.

Question: 2

What do you understand by Context Initialization Parameters?

  The context param element contains the declaration of a web applications servlet context initialization parameters.

name

value

 

The Context Parameters page lets you manage parameters that are accessed through the ServletContext.getInitParameterNames and ServletContext.getInitParameter methods.

Question: 3

What are JSP Custom tags?

  • JSP Custom tags are user defined JSP language element. JSP custom tags are user defined tags that can encapsulate common functionality.
  • For example you can write your own tag to access the database and performing database operations.
  • You can also write custom tag for encapsulating both simple and complex behaviors in an easy to use syntax and greatly the readability of JSP pages.

Question: 4

What mechanisms are used by a Servlet Container to maintain Session Information?

Servlet Container uses Cookies, URL rewriting and HTTPS protocol information to maintain the session.

Question: 5

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.

Related Questions