[opencms-dev] How to include a jsp into a html?

Thomas M�rz thomasmaerz at gmx.de
Sun Sep 5 13:59:07 CEST 2004


Farnaz Fotrousi <f_fotrousi at yahoo.com> writes:

> I have created some pages which use pre-created templates. But in some
> cases, I need to include some dynamic pages like JSPs. For instance I
> want to show search results (search.jsp) in a page which has other
> static contents, too. As "iframe" tag is not supported by some
> browsers, I prefer to find another way to include JSPs.

Everywhere I want to include a dynamic file I set a page property
jsp_include to a filename. And in my template I put:

,----
| <%
| String jsp = cms.property( "jsp_inlcude", "uri", "empty.txt" );
| StringTokenizer tokenizer = new StringTokenizer( jsp, ";" );
| String token = null;
| 
| while ( tokenizer.hasMoreTokens() )
| {
|     token = tokenizer.nextToken();
|     cms.include( "../elements/" + token );
| }
| %>
`----

HTH




More information about the opencms-dev mailing list