Grzegorz Kossakowski skrev:
Hi,
Yes, it's me n-th time ;)
I would like to discuss link rewriting in js files and other text
resources (css for example). Obviosuly, soon or later, there will be
need (actually it already is, in Forms) to store some paths in JS files.
That means that we have to take care of rewriting links in this kind of
resources.
My proposal is to introduce new reader for this task. It would scan
whole content of file for valid URLs to rewrite, and do the job. I
think, it could be easily achieved by use of some regexps. Of course,
this new reader would implement caching because rewriting of some big
files would be quite time-consuming.
I haven't looked into the code of LinkRewritingTransformer so I'm not
sure if it's code could be reused. Even if I had to write it from
scratch I'm enough motivated but need to be sure that my work is not
waste of time.
Do you have any thoughts? Other options?
I agree with that we need a rewriting transformer. For the actual
implementation I don't think there is much to reuse from the
LinkRewritingTransformer. There is a large difference in scanning SAX
and a stream, for attributes. Furthermore I would propose making it
specialized for rewriting the servlet protocol, so that the only
configuration parameter is what attributes to rewrite.
/Daniel