I have read some tutorials about web services and I see that I can return HTML to the client of the service via concatenating
String. It reminds me of embedding html inside
servlet.
http://docs.oracle.com/javaee/6/tutorial/doc/gipzz.html#girci
In the example, it's very clear that they embed html code inside
Java code:
@GET
@Produces("text/html")
public String getHtml() {
return "<html lang=\"en\"><body><h1>Hello, World!!</body></h1></html>";
}
My question is: is there any template system for Java Web Service which helps me build HTML document and return it to client? Something that act like a
JSP to servlet. I don't like to embed HTML inside web service method this way.
I have asked this question on StackOverflow but some idiots there just down voted my questions without telling me reasons.
http://stackoverflow.com/questions/16890424/html-template-for-java-web-services