You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bo Gao <el...@gmail.com> on 2011/12/22 11:21:26 UTC

How to get Html Source of a Page

I have a page, how can I get the page's HTML source as a String in another page or Service method?


--
Bo Gao
elivoa@gmail.com







Re: How to get Html Source of a Page

Posted by Bo Gao <el...@gmail.com>.
Thank you, Chris, this is what I am looking for.
	
On Dec 22, 2011, at 6:40 PM, Christian Köberl wrote:

> 2011-12-22 11:21, Bo Gao:
>> I have a page, how can I get the page's HTML source as a String in another page or Service method?
> 
> You can get the real Source by Class#getResourceAsStream(String), e.g.
> Index.class.getResourceAsStream("/test/Index.tml");
> 
> If you want to generate content of your template to send it via email
> you can use:
> http://tapestry.formos.com/nightly/tapx/tapx-templating/
> 
> -- 
> Chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

--
Bo Gao
elivoa@gmail.com







Re: How to get Html Source of a Page

Posted by Christian Köberl <ta...@gmail.com>.
2011-12-22 11:21, Bo Gao:
> I have a page, how can I get the page's HTML source as a String in another page or Service method?

You can get the real Source by Class#getResourceAsStream(String), e.g.
Index.class.getResourceAsStream("/test/Index.tml");

If you want to generate content of your template to send it via email
you can use:
http://tapestry.formos.com/nightly/tapx/tapx-templating/

-- 
Chris

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


Re: How to get Html Source of a Page

Posted by Christian Riedel <cr...@googlemail.com>.
what do you want to do with the source?
whatever it is, I think it's going to be very inefficient.

except you want to use it for testing. for that case I recommend the PageTester.


Am 22.12.2011 um 11:21 schrieb Bo Gao:

> I have a page, how can I get the page's HTML source as a String in another page or Service method?
> 
> 
> --
> Bo Gao
> elivoa@gmail.com
> 
> 
> 
> 
> 
> 


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