Spring Boot/Spring Boot - CORS Sample Test,Sample questions

Question:
 @Bean configuration to set the CORS configuration support globally to your Spring Boot application.

1.true

2.flase

Posted Date:-2020-11-25 01:24:33


Question:
@Bean
public WebMvcConfigurer corsConfigurer() {
   return new WebMvcConfigurerAdapter() {
      @Override
      public void addCorsMappings(CorsRegistry registry) {
         registry.addMapping("/products").allowedOrigins("http://localhost:9000");
      }    
   };
}

1.Syntax to set the CORS configuration support globally to your Spring Boot application.

2.Syntax to set the CORS configuration support specific REST API .

3.Both

4.None

Posted Date:-2020-11-25 01:27:33


Question:
@CrossOrigin annotation supports specific REST API

1.true

2.false

Posted Date:-2020-11-25 01:09:42


Question:
@CrossOrigin annotation supports specific REST API, and not for the entire application.

1.Yes

2.No

Posted Date:-2020-11-25 01:21:31


Question:
Choose correct for CORS 

1.CORS prevents the JavaScript code producing or consuming the requests against different origin

2.CORS is a security concept that allows restricting the resources implemented in web browsers.

3.Both

4.Only 1

Posted Date:-2020-11-25 00:46:57


Question:
CORS Configuration can be Globally? 

1.Yes

2.No

Posted Date:-2020-11-25 01:23:44


Question:
CORS is a security concept that allows restricting the resources implemented in web browsers

1.true

2.flase

Posted Date:-2020-11-25 00:37:08


Question:
Enable CORS in Controller Method

1.@RequestMapping(value = "/products") @CrossOrigin(origins = "http://localhost:8080") public ResponseEntity getProduct() { return null; }

2.@RequestMapping(value = "/products") @CrossCORSOrigin(origins = "http://localhost:8080") public ResponseEntity getProduct() { return null; }

3.Both

4.None

Posted Date:-2020-11-25 01:22:46


Question:
Full name of CORS?

1.Cross-Origin Resource Sharing (CORS)

2.Cross-Origin Resource and Servers

3.Cross-Origin Resource and Services

4.None

Posted Date:-2020-11-25 00:36:34


More MCQS

  1. Spring Boot Common Test
  2. Spring Boot - Bootstrapping
  3. Spring Boot - Logging
  4. Spring Boot - Application Properties
  5. Spring Boot - RESTful Web Services
  6. Spring Boot - Exception Handling
  7. Spring Boot - Interceptor
  8. Spring Boot - File Handling
  9. Spring Boot - CORS
  10. Spring Boot - Internationalization
  11. Spring Boot - Scheduling
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!