Create a page without a template
Hi I'm trying to create a httpstatus page that does nothing more than return a 200 response. Is there a way to do this without having to create a template? I know I can do things like this with MarkupWriter in a component, I just don't know how to do it in a page. -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York
Re: Create a page without a template
On Thu, 30 Oct 2014 15:07:03 -0200, George Christman gchrist...@cardaddy.com wrote: Hi I'm trying to create a httpstatus page that does nothing more than return a 200 response. Is there a way to do this without having to create a template? Yep! Just have its onActivate() method return a StreamResponse (probably an empty TextStreamResponse, as it seems the only part here is to set a response header). You can also use MarkupWriter, as pages require some content to be generated, but a StreamResponse is more adequate in this case, IMHO. For a non-page solution for doing the same, you can write a Dispatcher. I know I can do things like this with MarkupWriter in a component, I just don't know how to do it in a page. MarkupWriter, afterRender(), etc work in exact the same way in pages and components. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Create a page without a template
Thanks Thiago, sounds pretty simple :) On Oct 30, 2014 1:14 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 30 Oct 2014 15:07:03 -0200, George Christman gchrist...@cardaddy.com wrote: Hi I'm trying to create a httpstatus page that does nothing more than return a 200 response. Is there a way to do this without having to create a template? Yep! Just have its onActivate() method return a StreamResponse (probably an empty TextStreamResponse, as it seems the only part here is to set a response header). You can also use MarkupWriter, as pages require some content to be generated, but a StreamResponse is more adequate in this case, IMHO. For a non-page solution for doing the same, you can write a Dispatcher. I know I can do things like this with MarkupWriter in a component, I just don't know how to do it in a page. MarkupWriter, afterRender(), etc work in exact the same way in pages and components. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Create a page without a template
And perhaps a @NotSecure annotation to go with it ;). On 30 Oct 2014 17:40, George Christman gchrist...@cardaddy.com wrote: Thanks Thiago, sounds pretty simple :) On Oct 30, 2014 1:14 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 30 Oct 2014 15:07:03 -0200, George Christman gchrist...@cardaddy.com wrote: Hi I'm trying to create a httpstatus page that does nothing more than return a 200 response. Is there a way to do this without having to create a template? Yep! Just have its onActivate() method return a StreamResponse (probably an empty TextStreamResponse, as it seems the only part here is to set a response header). You can also use MarkupWriter, as pages require some content to be generated, but a StreamResponse is more adequate in this case, IMHO. For a non-page solution for doing the same, you can write a Dispatcher. I know I can do things like this with MarkupWriter in a component, I just don't know how to do it in a page. MarkupWriter, afterRender(), etc work in exact the same way in pages and components. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Create a page without a template
That's a functional annotation? On Thu, Oct 30, 2014 at 1:56 PM, Lance Java lance.j...@googlemail.com wrote: And perhaps a @NotSecure annotation to go with it ;). On 30 Oct 2014 17:40, George Christman gchrist...@cardaddy.com wrote: Thanks Thiago, sounds pretty simple :) On Oct 30, 2014 1:14 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 30 Oct 2014 15:07:03 -0200, George Christman gchrist...@cardaddy.com wrote: Hi I'm trying to create a httpstatus page that does nothing more than return a 200 response. Is there a way to do this without having to create a template? Yep! Just have its onActivate() method return a StreamResponse (probably an empty TextStreamResponse, as it seems the only part here is to set a response header). You can also use MarkupWriter, as pages require some content to be generated, but a StreamResponse is more adequate in this case, IMHO. For a non-page solution for doing the same, you can write a Dispatcher. I know I can do things like this with MarkupWriter in a component, I just don't know how to do it in a page. MarkupWriter, afterRender(), etc work in exact the same way in pages and components. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- George Christman CEO www.CarDaddy.com P.O. Box 735 Johnstown, New York
Re: Create a page without a template
On Thu, 30 Oct 2014 16:26:57 -0200, George Christman gchrist...@cardaddy.com wrote: That's a functional annotation? Nope, a suggestion. :) -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Create a page without a template
Lol ok, i was excited for a min ;) On Oct 30, 2014 2:41 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 30 Oct 2014 16:26:57 -0200, George Christman gchrist...@cardaddy.com wrote: That's a functional annotation? Nope, a suggestion. :) -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Create a page without a template
On Thu, 30 Oct 2014 17:14:04 -0200, George Christman gchrist...@cardaddy.com wrote: Lol ok, i was excited for a min ;) ;) Well, you can stil be excited and implement the annotation, as you're already implementing a class transformation. :) -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Create a page without a template
lol okay, I guess I'll have to learn how to create an annotation ;) On Thu, Oct 30, 2014 at 3:26 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 30 Oct 2014 17:14:04 -0200, George Christman gchrist...@cardaddy.com wrote: Lol ok, i was excited for a min ;) ;) Well, you can stil be excited and implement the annotation, as you're already implementing a class transformation. :) -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- George Christman CEO www.CarDaddy.com P.O. Box 735 Johnstown, New York
Re: Create a page without a template
to expedite, checkout jumpstart's @EJB for reference, similar sic class transformation worker2 implementation On Fri, 31 Oct 2014 11:56:54 +1100, George Christman gchrist...@cardaddy.com wrote: lol okay, I guess I'll have to learn how to create an annotation ;) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org