It allows access to request and response headers.


, 2.

It doesn't allow access to request and response headers.


, 3.

It returns a JSON String and sets the mimetype to text/plain.


, 4.

It returns a JSON String and sets the mimetype to text/javascript.


">
MCQs > IT & Programming > Spring MVC >

Given the following method:

@RequestMapping(method=RequestMethod.GET, value="/fooBar")

    public ResponseEntity<String> fooBar2() {

      String json = "jsonResponse";

      HttpHeaders responseHeaders = new HttpHeaders();

      responseHeaders.setContentType(MediaType.APPLICATION_JSON);

      return new ResponseEntity<String>(json, responseHeaders, HttpStatus.CREATED);

    }

Which of the following statements is correct?

Spring MVC MCQs

Given the following method:

@RequestMapping(method=RequestMethod.GET, value="/fooBar")

    public ResponseEntity<String> fooBar2() {

      String json = "jsonResponse";

      HttpHeaders responseHeaders = new HttpHeaders();

      responseHeaders.setContentType(MediaType.APPLICATION_JSON);

      return new ResponseEntity<String>(json, responseHeaders, HttpStatus.CREATED);

    }

Which of the following statements is correct?

Answer

Correct Answer:

It returns a JSON String and sets the mimetype to text/javascript.


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Spring MVC Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More Spring MVC MCQ Questions

search

Spring MVC Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it