That works , thank you!
But I have another question:
when I use requestLogger.getLiveSessions() to get the live sessions,the
number of sessions always increased after I call the render api.
Is it possible to render page of html source in the same session(not create
a new one)?
Thank you!


Scott Swank wrote:
> 
> Here is a largely equivalent class that I created.  It simply extends
> BaseWicketTester.
> 
> public class PageRenderer extends BaseWicketTester {
>       private final Locale locale;
> 
>       public PageRenderer(Locale locale) {
>               this.locale = locale;
>       }
> 
>       public PageRenderer() {
>               this.locale = null;
>       }
> 
>       private String renderStartPage() {
>               if (this.locale != null) {
>                       getWicketSession().setLocale(locale);
>               }
> 
>               return getServletResponse().getDocument();
>       }
> 
>       public synchronized String render(Class<? extends WebPage> pageClass) {
>               startPage(pageClass);
>               return renderStartPage();
>       }
> 
>       public synchronized String render(Class<? extends WebPage> pageClass,
> PageParameters parameters) {
>               startPage(pageClass, parameters);
>               return renderStartPage();
>       }
> 
>       public synchronized String render(WebPage page) {
>               startPage(page);
>               return renderStartPage();
>       }
> 
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Render-a-Wicket-page-to-a-string-for-HTML-email-tp20325702p27914411.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to