Java.Servlet

What is a “servlet”?

What are the advantages of servlet technology over CGI (Common Gateway Interface)?

What is the structure of a web project?

What is a “servlet container”?

Why do we need application servers if we have servlet containers?

How does a servlet container manage the servlet life cycle, when and what methods are called?

What about synchronization and multithreading issues in servlet container ? Do we have smth right out of the box ?

What is deployment descriptor ?

What steps should be taken when creating servlets?

When is it necessary to override the service() method?

Does it make sense to define a constructor for a servlet? What is the best way to initialize data?

Why is it necessary to override only the init() method without arguments?

What are the most common tasks performed in a servlet container?

What do you know about servlet filters?

Listeners

When should you use servlet filters and when listeners?

How can you implement servlet startup at the same time as the application startup?

What is 1 in loadOnStartup = 1 ?

How to handle exceptions thrown by another servlet in an application?

What is ServletConfig?

What is ServletContext?

What is the difference between ServletContext and ServletConfig?

If i have 2 servlets, will i have 2 instances of ServletConfig ?

What is the ServletResponse interface for?

What Is ServletRequest?

What is Request Dispatcher?

How do I call another servlet from one servlet?

What is the difference between sendRedirect() and forward()?

What are servlet attributes used for and how do I work with them?

How can I allow a deadlock in a servlet?

How can I get the actual location of a servlet on the server?

How can I get server information from a servlet?

How can I get the client’s IP address on the server?

What servlet wrapper classes do you know?

Difference between Filters and Listeners

Examples of listeners

What are the differences between GenericServlet and HttpServlet?

Why is the HttpServlet class declared as abstract?

What are the main methods in the HttpServlet class?

Should I worry about multithreaded safety when working with servlets?

Which HTTP method is not immutable?

What are the methods for sending data from the client to the server?

What is the difference between GET and POST?

What is the difference between PrintWriter and ServletOutputStream?

Can PrintWriter and ServletOutputStream be used simultaneously in a servlet?

Explain the SingleThreadModel interface.

What does URL encoding mean? How can it be implemented in Java?

What happens to symbols when i don’t encode them in URL, give example ?

What are the different methods of session management in servlets?

What are cookies?

What are the methods for working with cookies provided in servlets?

Can i delete Cookie ?

What is URL Rewriting?

What is the purpose and difference between encodeURL() and encodeRedirectURL()?

What exactly encodeRedirectURL does ?

What is session ?

How can we notify an object in a session that the session is invalid or expired?

What is an effective way to ensure that all servlets are accessible only to a user with a valid session?

How can we provide transport layer security for our web application?

How can we organize a database connection, provide logging in a servlet?

If i created connection pool, when it should be destroyed ?

Should i close connection in my code if i use connection pool ?

What are the main features introduced in the Servlet 3 specification?

What authentication methods are available to a servlet?

What are Java Server Pages (JSP)?

Why do we need JSP?

JSP Request-to-Response Lifecycle

Explain the stages (phases) of the JSP life cycle.

Servlet.Explain the methods of the JSP life cycle.

Which JSP life cycle methods can be overridden?

How can we prevent direct access to a JSP page from a browser?

What is the difference between dynamic and static JSP content?

How to comment out code in JSP?

What are the main types of JSP tags?

What do you know about JSP actions (Action tag and JSP Action Elements).JSP – servlet – JSP interaction.

What variable scopes exist in JSP?

What is a JavaBean?

What implicit, internal objects and methods are there in a JSP page?

What implicit objects are not available in a regular JSP page?

What do you know about PageContext and what are the advantages of using it?

How to configure initialization parameters for JSP?

Why is it not recommended to use scriptlets (script elements) in JSP?

Is it possible to define a class inside a JSP page?

What do you know about JSP Expression Language (EL)?

What types of EL operators do you know?

Name the implicit, internal JSP EL objects and how they differ from JSP objects.

How to disable the ability to use EL in JSP?

How to find out the type of HTTP method using JSP EL?

What is JSTL (JSP Standard tag library)?

What tag groups does the JSTL library consist of?

What is the difference between <c:set> and <jsp:useBean>?

What is the difference between <c:import> and <jsp:include> and the <%@include %> directive?

How can you extend the functionality of JSP?

What do you know about writing custom JSP tags?

Give an example of using your own tags.

How to make a line break in HTML using JSP?

Why is it not necessary to configure standard JSP tags in web.xml?

How can I handle errors in JSP pages?

How does error handling work with JSTL?

How is JSP configured in the deployment descriptor.

Can I use Javascript in a JSP page?

Is a session object always created in a JSP page ?