Patrick Heiden pisze:

I think the basic idea is simple and elegant - so all one needs to do is 
configure mod-cache to
handle expires properly (what should be easy for statics like e.g. imgs, 
hopefully ;) and then
use servlet:/somegif.gif inside HTML. Would really enjoy to try this out, but 
need further
information about howto actually enable access via servlet:/ inside HTML. Maybe 
assume I am using
JXTemplates or some other view-tech wich contain some cachable statics. From my 
(shorttime
cocoon) experience this would then work fine (even if one calls statics inside 
e.g. css inside
conventional resource/ directory).

The trick with servlet: protocol inside HTML is that before serializing it to the browser (or httpd) it must be /rewritten/. Obviously, both httpd and browser have no idea what 'servlet:' protocol thing is so just before serializing the HTML you need to add servletLinkRewriter transformer. Your pipeline should look like:
<map:generate src="some_jx_template_for_html.jx" type="jx"/>

[some transformation steps here]

<map:transform type="servletLinkRewriter"/>
<map:serialize type="html"/>

The magic performed by servletLinkRewriter (coming from cocoon-servlet-service-components) is not that mysterious. Basically, it scans for href and src attributes containing servlet: protocol URLs. Then it uses some machinery from SSF in order to translate servlet:/** path into path that browser can understand.

Suppose everything happens in a servlet named 'foo' and mounted at /foo_mount/. If servletLinkRewriter encounters URL like servlet:/external/logo.gif it translates it into /foo_mount/external/logo.gif that browser can obviously handle.

This way, if browser asks for /blocks_mount_path/external/logo.gif it's being dispatched by SSF to foo servlet that will see it as a request for /external/logo.gif resource which is exactly that servlet:/external/logo.gif means here!

It's worth to note that servletLinkRewriter supports polymorphism and there is servletLinkRewriter *reader* that can deal with e.g. CSS files and links inside them.

Besides: do you have additional information about cocoon-auth block for usage 
in production. I am
trying to enable users to log in from another host and then they should 
automatically routed to
their last view. Ideally the left host should be pointed to login again.

Unfortunately not.

Will dig throug your mentioned apache-wiki and try to test your suggestions, 
greetings, Patrick

Great. As I said, it would be nice if you could share your experiences (possibly by writing some tutorials).

--
Best regards,
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to