There is a way to generate HTML from a REST API Call

If a Service class and when I call a function from a browser I want to display a HTML page. exemple :

public String test2() {
   return "<b><i>OK</i></b>";

when I open the link below

I see all the tags. How can I do to display html?

I resolved the issue by using a @RestController and injecting the service used