You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/07/25 15:43:48 UTC

t5: page class without tml file

Hi,

I have quite a number of page classes that simply returns a
TextStreamResponse in onActivate, is there a way to omit the tml file?
Thanks,

Angelo
-- 
View this message in context: http://www.nabble.com/t5%3A-page-class-without-tml-file-tp24658062p24658062.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: page class without tml file

Posted by Igor Drobiazko <ig...@gmail.com>.
Just put the content of your TextStreamResponse into writer.writeRaw() in
the example I sent before and remove your template.

On Sat, Jul 25, 2009 at 4:17 PM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> Hi,
>
> Looks like good news! now excuse my ignorance, how to use it? here is my
> class:
>
> public class MyPage {
>
>   TextStreamResponse onActivate(String params) {
>     ....
>    }
> }
>
> Igor Drobiazko wrote:
> >
> > Yep!
> >
> > public class PageWithoutTemplate {
> >
> >    void beginRender(MarkupWriter writer) {
> >       writer.element("html");
> >       writer.defineNamespace(
> >              "http://tapestry.apache.org/schema/tapestry_5_1_0.xsd",
> >              "t");
> >       writer.element("body");
> >       writer.writeRaw("Hello, World!");
> >       writer.end();
> >       writer.end();
> >    }
> > }
> >
> >
> > On Sat, Jul 25, 2009 at 3:43 PM, Angelo Chen
> > <an...@yahoo.com.hk>wrote:
> >
> >>
> >> Hi,
> >>
> >> I have quite a number of page classes that simply returns a
> >> TextStreamResponse in onActivate, is there a way to omit the tml file?
> >> Thanks,
> >>
> >> Angelo
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/t5%3A-page-class-without-tml-file-tp24658062p24658062.html
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > Best regards,
> >
> > Igor Drobiazko
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/t5%3A-page-class-without-tml-file-tp24658062p24658324.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko

Re: t5: page class without tml file

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

Looks like good news! now excuse my ignorance, how to use it? here is my
class:

public class MyPage {

   TextStreamResponse onActivate(String params) {
     ....
   }
}

Igor Drobiazko wrote:
> 
> Yep!
> 
> public class PageWithoutTemplate {
> 
>    void beginRender(MarkupWriter writer) {
>       writer.element("html");
>       writer.defineNamespace(
>              "http://tapestry.apache.org/schema/tapestry_5_1_0.xsd",
>              "t");
>       writer.element("body");
>       writer.writeRaw("Hello, World!");
>       writer.end();
>       writer.end();
>    }
> }
> 
> 
> On Sat, Jul 25, 2009 at 3:43 PM, Angelo Chen
> <an...@yahoo.com.hk>wrote:
> 
>>
>> Hi,
>>
>> I have quite a number of page classes that simply returns a
>> TextStreamResponse in onActivate, is there a way to omit the tml file?
>> Thanks,
>>
>> Angelo
>> --
>> View this message in context:
>> http://www.nabble.com/t5%3A-page-class-without-tml-file-tp24658062p24658062.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> 
> 

-- 
View this message in context: http://www.nabble.com/t5%3A-page-class-without-tml-file-tp24658062p24658324.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: page class without tml file

Posted by Igor Drobiazko <ig...@gmail.com>.
Yep!

public class PageWithoutTemplate {

   void beginRender(MarkupWriter writer) {
      writer.element("html");
      writer.defineNamespace(
             "http://tapestry.apache.org/schema/tapestry_5_1_0.xsd",
             "t");
      writer.element("body");
      writer.writeRaw("Hello, World!");
      writer.end();
      writer.end();
   }
}


On Sat, Jul 25, 2009 at 3:43 PM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> Hi,
>
> I have quite a number of page classes that simply returns a
> TextStreamResponse in onActivate, is there a way to omit the tml file?
> Thanks,
>
> Angelo
> --
> View this message in context:
> http://www.nabble.com/t5%3A-page-class-without-tml-file-tp24658062p24658062.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko

Re: t5: page class without tml file

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sat, 25 Jul 2009 10:43:48 -0300, Angelo Chen  
<an...@yahoo.com.hk> escreveu:

> Hi,

Hi!

> I have quite a number of page classes that simply returns a
> TextStreamResponse in onActivate, is there a way to omit the tml file?

When you always return a StreamResponse in onActivate() or any other event  
handler method, you don't need a template. No need to use MarkupWriter.  
One of my projects has a page class that loads images from a database and  
it doesn't have a template (nor it would make sense to have one). Works  
like a charm. :)

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org