What is easiest way to configure a WebPage with no html markup? I would like something like (for testing purporse...)

public MyPage extends WebPage {
    ...
    public String getMarkup() {
        return "<html></html>";
    }
}

I struggled and find this way that I think is a lot of hack, so I would like to know others:

DefaultResourceStreamLocator locator = (DefaultResourceStreamLocator) application.getResourceStreamLocator();
locator.add(new AbstractResourceStreamLocator() {
    protected IResourceStream locate(ClassLoader classLoader, String path) {
        return new StringResourceStream("<html></html>");
    }
});

Reply via email to