This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have this sample project running that uses Grizzly and Jersey. The project works and serves up a REST request. I was wondering how I can also serve up static HTML from this. I have done some searching on GOOGLE but have found very little.
Of course you can serve static HTML from your service. Personally, I would think of it as a static resource in HTML format.
I would consider having some kind of handler for the root URI at which static HTML.
The handler would, when receiving a request, examine a particular directory, in which files containing static HTML are stored.
There may also be subdirectories in this particular directory, allowing for grouping of HTML resources etc.
Returning a static HTML resource is then accomplished by reading the contents of the appropriate file and returning the contents as a string.
The above is just a suggestion that I come to think of, there may be more appropriate designs for your particular scenario.