Sr.Java Web Developer Question:
Download Questions PDF

Tell us what are some of the important Spring annotations which you have used?

Sr.Java Web Developer Interview Question
Sr.Java Web Developer Interview Question

Answer:

Some of the Spring annotations that I have used in my project are:

☛ @Controller – for controller classes in Spring MVC project.

☛ @RequestMapping – for configuring URI mapping in controller handler methods. This is a very important annotation, so you should go through Spring MVC RequestMapping Annotation Examples

☛ @ResponseBody – for sending Object as response, usually for sending XML or JSON data as response.

☛ @PathVariable – for mapping dynamic values from the URI to handler method arguments.

☛ @Autowired – for autowiring dependencies in spring beans.

☛ @Qualifier – with @Autowired annotation to avoid confusion when multiple instances of bean type is present.

☛ @Service – for service classes.

☛ @Scope – for configuring scope of the spring bean.

☛ @Configuration, @ComponentScan and @Bean – for java based configurations.

AspectJ annotations for configuring aspects and advices, @Aspect, @Before, @After, @Around, @Pointcut etc.

Download Sr.Java Web Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Explain me what is JDBC ResultSetMetaData interface?What is synchronized Throwable getCause()?