Re: How to render raw HTML
afaik all you need is a page that looks like this class rawpage extends webpage { public rawpage(final pageparameters p) { add(new label(content, new loadabledetachablemodel() { public object load() { return database.getmarkup(p.get(pageid)); } }.setescapemodelstrings(false)); } } -igor On Tue, Dec 1, 2009 at 2:54 PM, Alec Swan alecs...@gmail.com wrote: I am using Wicket 1.4.2 and would like to be able to render raw HTML pages which are stored in an existing database. I saw that other people attempted doing thishttp://markmail.org/message/sleaiygl3buwgqcn#query:AutoComponentPanel+page:1+mid:sleaiygl3buwgqcn+state:resultsand am wondering if there is a way to do this without creating a lot of custom code? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: How to render raw HTML
There was this little class somewhere in help. Obviously needs a little change for getting actual content and piping it out, but from here - it's not far. Hope this helps. /** * Use if you want to redirect entire page and dump this one. */ static class ImportTag extends WebMarkupContainer { private static final long serialVersionUID = 1L; ImportTag(String id) { super(id); } @Override protected void onRender(MarkupStream markupStream) { markupStream.next(); try { WebRequestCycle cycle = (WebRequestCycle) RequestCycle.get(); ServletRequest request = cycle.getWebRequest().getHttpServletRequest(); ServletResponse response = cycle.getWebResponse().getHttpServletResponse(); ServletContext context = ((WebApplication) Application.get()).getServletContext(); context.getRequestDispatcher(/ + getId() + .html).include(request, response); } catch (Exception e) { throw new WicketRuntimeException(e); } } } // class ImportTag -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Tuesday, December 01, 2009 5:55 PM To: users@wicket.apache.org Subject: How to render raw HTML I am using Wicket 1.4.2 and would like to be able to render raw HTML pages which are stored in an existing database. I saw that other people attempted doing thishttp://markmail.org/message/sleaiygl3buwgqcn#query:AutoComponentPanel+p age:1+mid:sleaiygl3buwgqcn+state:resultsand am wondering if there is a way to do this without creating a lot of custom code? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org