AJ Common Short Answers
AJ Common Short Answers
Q.3. Explain Data Access operations with JdbcTemplate Class and RowMapper Interface.
Q.4. What is Spring Boot? Explain Spring Boot RESTful WebService with example
Q.5.. Explain all standard action in JSP and write JSP code using this standard action for Login Page.
Q.6. What are actions in JSP? Explain any four actions in JSP with suitable example.
Q.7. Explain Dependency Injection with Spring via Setter Injection with suitable example.
Q.8. Why do we need Generics? Explain with an example of how Generics make a program more
flexible?
Q12. What is Lambda Expression? Write code on it using Lambda expression as an Object.
Q.15. Explain session management in JSP with its types. Write variable value counter program using
cookies.
Q.16. What is Collections? Explain Set, Map, HashMap, List and Vector each classes with suitable
code compulsorily.
Directives are instructions to the JSP container that affect the overall structure and behavior of a JSP
page.
Types of directives:
1. Page Directive: Defines page-specific attributes like content type, error pages, etc.
Example: <%@ page contentType="text/html" language="java" %>
2. Include Directive: Includes the content of another file during page translation.
Example: <%@ include file="header.jsp" %>
In Spring AOP, advice is the action taken at a join point (specific points in the execution of a
program).
Types of Advice:
Q3. Explain Data Access operations with JdbcTemplate Class and RowMapper Interface.
• JdbcTemplate Class: Simplifies database operations like query execution, updates, and stored
procedures.
2. Create a controller:
@RestController
@RequestMapping("/api")
@GetMapping("/hello")
Q5. Explain all standard action in JSP and write JSP code using this standard action for Login Page.
Q6. What are actions in JSP? Explain any four actions in JSP with suitable example.
Actions in JSP allow dynamic content creation and interaction with server components.
Dependency Injection allows injecting dependencies instead of creating them inside a class.
Setter Injection Example:
this.name = name;
</bean>
Q8. Why do we need Generics? Explain with an example of how Generics make a program more
flexible?
Generics ensure type safety and eliminate the need for typecasting.
Example:
Spring AOP (Aspect-Oriented Programming) allows separating cross-cutting concerns like logging.
Key Concepts:
Spring Framework provides dependency injection, AOP, MVC, etc., using modules like Core, Data
Access, Web, and AOP.
(Diagram: Core at center, surrounded by modules like Web, AOP, etc.)
Q12. What is Lambda Expression? Write code on it using Lambda expression as an Object.
<%
int count = 1;
if (cookies != null) {
if (cookie.getName().equals("visitCount")) {
count = Integer.parseInt(cookie.getValue()) + 1;
%>
Q16. What is Collections? Explain Set, Map, HashMap, List, and Vector each class with suitable
code.
Collections are frameworks for handling data structures like lists, sets, and maps.
Examples:
Predefined objects in JSP like request, response, session, application, out, etc., to simplify
development.
POJO (Plain Old Java Object): Simple Java object with no special restrictions.
Example: