[opencms-dev] static export pages with GET parameters

Ivan Jelenic ivan.jelenic at nbs.yu
Fri Jun 27 08:12:02 CEST 2003


Hi,

Yesterday I've worked on my printer-friendly pages. First I used XML
templates did something like you and it was OK in offline mode. For
generating printer-friendly pages I am using another jsp file named
print.jsp. The scenario is maybe complicated but it works.
In the jsptemplate put this:
...
<%
// Create a JSP action element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);

// Create a string of requested file
String filename = cms.getRequestContext().getUri();
%>
.....
<a href="<cms:link>/Home/print.jsp</cms:link>?file=<%= filename %>"
target="_blank">Print version</a>

And then made print.jsp file with this:
...
<%
// Create a JSP action element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);

String uriForPrinting = request.getParameter("file");
cms.include(uriForPrinting);
%>
....

Hope it helps!!!
Best regards Ivan.

----- Original Message ----- 
From: "Thomas Hieck" <hkt at gmx.net>
To: <opencms-dev at opencms.org>
Sent: Thursday, June 26, 2003 10:25 PM
Subject: [opencms-dev] static export pages with GET parameters


> Hi there,
> I need a little help with an export problem.
>
> In my master template I defined the jsp-template and a
> belonging printversion:
>
>   <?xml version="1.0" encoding="ISO-8859-1"?>
>   <xmltemplate>
>       <template>
>           <element name="jsptemplate"/>
>       </template>
>       <elementdef name="jsptemplate">
>           <class>com.opencms.flex.CmsJspTemplate</class>
>           <template>../jsptemplates/de_home</template>
>       </elementdef>
>       <template name="print">
>           <element name="printtemplate"/>
>       </template>
>       <elementdef name="printtemplate">
>           <class>com.opencms.flex.CmsJspTemplate</class>
>           <template>../jsptemplates/print</template>
>       </elementdef>
>   </xmltemplate>
>
> I call this printversion with the "?cmsframe=print" parameter
> in the uri, as is documented.
>
>   http://127.0.0.1:8180/opencms/opencms/test.html?cmsframe=print
>
> Works fine. But how can I statically export this print-version
> for my page?
> Any idea? Is there a better solution to do a print-version?
>
> thanks, thomas.
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list