Accessing views with controllers

Report a typo

Complete the code below to have a valid return type.

Java
@Controller
public class UserController {

    @GetMapping(value = "/user", produces = MediaType.TEXT_HTML_VALUE)
    @ResponseBody
    public ________ greetUser() {
        return "<html><p>Hello and Welcome!</p></html>";
    }
}
Kotlin
@Controller
class UserController {

    @GetMapping(value = ["/user"], produces = [MediaType.TEXT_HTML_VALUE])
    @ResponseBody
    fun greetUser(): ________ {
        return "<html><p>Hello and Welcome!</p></html>"
    }
}
Select one option from the list
___

Create a free account to access the full topic