Posts in 2024
  • Consume REST Services

    Thursday, June 13, 2024 in Spring Interview Questions

    Consume REST Services RestTemplate Synchronous client WebClient Asynchronous client, part of Spring WebFlux FeignClient Synchronous and declarative client, part of Spring Cloud

    Read more

  • @Transactional

    Thursday, June 13, 2024 in Spring Interview Questions

    @Transactional @Transactional on method means that the entire method will run in a single transaction. If any exception occurs during the execution of this method, the transaction will be rolled back, ensuring data consistency

    Read more

  • Interceptor

    Thursday, June 13, 2024 in Spring Interview Questions

    Interceptor Interceptors in Spring allow you to intercept HTTP requests and responses Step Create a class which implement the HandlerInterceptor interface @Component public class MyInterceptor implements HandlerInterceptor { @Override public boolean …

    Read more

  • Exception Handling

    Thursday, June 13, 2024 in Spring Interview Questions

    Exception Handling @ControllerAdvice Used on a class to make it a global exception handler @ExceptionHandler Used on methods within a @ControllerAdvice class to define the HTTP response for specific exceptions @ControllerAdvice public class …

    Read more

  • @CrossOrigin

    Thursday, June 13, 2024 in Spring Interview Questions

    @CrossOrigin @CrossOrigin enable CORS request on whole controller or certain methods

    Read more

  • Authentication, Authorization

    Thursday, June 13, 2024 in Spring Interview Questions

    Authentication, Authorization Authentication The process of verifying the identity of a user Authorization The process of verifying what an authenticated user is allowed to do

    Read more

  • Lombak

    Thursday, June 13, 2024 in Spring Interview Questions

    Lombak @Data annotation on POJO to generate boilerplate code such as getters, setters, toString, equals, and hashCode methods

    Read more

  • Object-Relational Mapping (ORM)

    Thursday, June 13, 2024 in Spring Interview Questions

    Object-Relational Mapping (ORM) ORM provides the foundational concept for mapping objects to relational databases Java Persistence API (JPA) standardizes ORM in Java, defining a set of rules and interfaces Hibernate implements JPA, offering the …

    Read more

  • Data Binding, Validation

    Thursday, June 13, 2024 in Spring Interview Questions

    Data Binding, Validation Data Binding @RequestParam @GetMapping("/search") public List<Item> searchItems( @RequestParam(name = "query") String query, @RequestParam(name = "page", required = false, defaultValue = …

    Read more

  • Request Mapping

    Thursday, June 13, 2024 in Spring Interview Questions

    Request Mapping @GetMapping @GetMapping("/users") public ResponseEntity<List<User>> getUsers() { List<User> users = // Fetch users return ResponseEntity.ok(users); } @PostMapping @PostMapping("/users") public …

    Read more