[opencms-dev] OpenCms and ZK
Roman Uhlig
roman.uhlig at knve.de
Mon Nov 20 16:03:32 CET 2006
Option C sounds great to me. Unfortunately I don't have any idea about
writing filters in web.xml :(
The default ZK web.xml contains the following part (disabled by default).
Any ideas how this could help:
<filter>
<filter-name>zkFilter</filter-name>
<filter-class>org.zkoss.zk.ui.http.DHtmlLayoutFilter</filter-class>
<init-param>
<param-name>extension</param-name>
<param-value>html</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>zkFilter</filter-name>
<url-pattern>/test/special.jsp</url-pattern>
</filter-mapping>
Thanks,
Roman
Christoph Schönfeld wrote:
>
> Right, my last suggestion was invalid. It is impossible to have URLs
> like "http://localhost:8080/opencms/yourfile.zul" getting processed by
> the ZK servlet if you do not disable the OpenCms servlet. The reason is
> that "/opencms/*" maps to the OpenCms servlet already. All requests to
> URLs starting with "http://localhost:8080/opencms/" are processed by the
> OpenCms servlet.
>
> Even if it were possible to remap a subset like /opencms/*.zul to a
> different servlet it wouldn't work because the ZUL files are not on
> disk, they are in the OpenCms VFS in the database.
>
> Option A:
> Store your *.zul files outside of OpenCms.
>
> The mapping would be "/zul/*" and URLs would be
> "http://localhost:8080/opencms/zul/yourfile.zul" (OpenCms urls would be
> "http://localhost:8080/opencms/opencms/...").
>
> Option B:
> You could also write a wrapper JSP which takes the ZUL file VFS path as
> a parameter, retrieves it using the OpenCms API and passes it to the ZK
> processor. The URLs would then be
> http://localhost:8080/opencms/zkwrapper.jsp?path=yourfile.zul.
>
> Option C:
> Write a Servlet filter and apply it to the opencms servlet mapping. The
> filter will be called before the OpenCms servlet. If your filter sees
> that the request ends with ".zul" you should then cache the OpenCms
> response which is the ZUL file and run the ZK processor on it.
>
> Option C is mor elegant than B. But A is definitely the easiest to do
> because you do not have to write code for it. However, you lose the
> ability to store the ZUL files in VFS.
>
> Any other ideas?
>
>
> Best regards,
> Christoph
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
--
View this message in context: http://www.nabble.com/OpenCms-and-ZK-tf2668499.html#a7443956
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.
More information about the opencms-dev
mailing list