[opencms-dev] publishing jsp code

Christian Steinert christian_steinert at web.de
Tue Jun 20 09:02:19 CEST 2006


Roberto Hervella MacĂ­a schrieb:
> Hi Jan,
>
> What I really want is to generate jsp content from a OpenCms template (which
> is also a jsp).
> I don't want to publish simply a flat jsp file, I want to generate a jsp
> file from a definited template.
> I've used the trick out.print(<JSP code>) inside the template to generate
> jsp code from a template, but I think it's a bit messy.
> There must be another way to publish jsp code from a OpenCms template. Do
> you know how to do it?
>
> Thanks,
>   
you can read the file contents and output THOSE with out.print, somewhat 
like this

        CmsObject cms = cmsJspActionElement.getCmsObject();
	CmsFile jspFile = cms.readFile("foo.jsp");
	String content = new String(jspFile.getContents());
	out.print(content);




hth
christian




More information about the opencms-dev mailing list