Thanks, Eugen, for taking the time for below.  However, that does not meet 
requirement.  Specifically, I am *NOT* wanting to write any HTML or tags, just 
stream simple text content to the browser.  In this case, just two words 
exactly as "Hello World".   No begin, end html tags (template would be simpler 
in that case).  I also tried writeRaw() method as below after looking up 
org.apache.tapestry5.MarkupWriter: 


      void beginRender(MarkupWriter writer) 
      {
        //writer.element("html");
        writer.writeRaw("Hello World");    
        //writer.end();
      }

Get the following error: 


Page ... did not generate any markup when rendered. This could be because its 
template file could not be located, or because a render phase method in the 
page prevented rendering.

I am looking into (perhaps) some usage of 
org.apache.tapestry5.services.StreamPageContent...the manual seems to suggest 
it is possible. 



On Saturday, August 2, 2014 11:58 AM, Eugen <eugens...@gmail.com> wrote:
 


Hi,
if You don't like to use the template (.tml) files the entire job is to be done 
in page class using the MarkupWriter,
a simple example:

public class Home{
    void beginRender(MarkupWriter writer) {
        writer.element("html");
        writer.write("test");
        writer.end();
    }
}

this will write to the output html the text "test".

in this case, important is to start the page with the <html> element.


Best regards

Eugen



2014-08-02 23:21 GMT+02:00 Net Dawg <net.d...@yahoo.com.invalid>:

Here is the simplest Hello World, according to jump start:
>http://jumpstart.doublenegative.com.au/jumpstart/helloworld
>
>
>I would like to do something simpler.  No html, body tags etc, just pure 
>streaming content.  Completely do away with templates and components, just use 
>the page class to stream "Hello World" to browser.
>
>
>In above example, I tried to set HelloWorld.tml as just
>
>
>${username}
>
>the idea being getUserName can be XML, PDF or whatever...but get the following 
>error:
>
>  Content is not allowed in prolog

Reply via email to