It retrieves the complete path value after the @RequestMapping and @PathVariable values have been parsed.


, 2.

It retrieves the complete path value before the @RequestMapping and @PathVariable values have been parsed.


, 3.

It retrieves the partial path value (after "**") after the @RequestMapping and @PathVariable values have been parsed.


, 4.

It retrieves the partial path value (after "**") before the @RequestMapping and @PathVariable values have been parsed.


">
MCQs > IT & Programming > Spring MVC >

What does the following code do?

@RequestMapping("/{id}/**")

public void foo(@PathVariable("id") int id, HttpServletRequest request) {

    String restOfTheUrl = (String) request.getAttribute(

        HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);

    ...

}

Spring MVC MCQs

What does the following code do?

@RequestMapping("/{id}/**")

public void foo(@PathVariable("id") int id, HttpServletRequest request) {

    String restOfTheUrl = (String) request.getAttribute(

        HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);

    ...

}

Answer

Correct Answer:

It retrieves the partial path value (after "**") before the @RequestMapping and @PathVariable values have been parsed.


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

search

Spring MVC Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it