Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

HTML Template for Java Web Service  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
In the example, it's very clear that they embed html code inside Java code:
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.
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are talking about a RESTful web service architecture, why not use JSP?
If you are talking about a SOAP web service - no, you are stuck with the very formal SOAP API for which there are toolkits.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!