I have a similar servlet - when the client requests some file, for example script.js, the servlet looks for script.js.template (<filename>.template), if it exists it is processed as template, else the servlet looks for script.js, and does the static output, without template processing. So I can replace any static text file (html, css, js,...) by a template version, without having to modifiy the url to be used by the client.
In my solution it would also be possible to use different (template) processing engines - for example use <filename>.vm for velocity templates, and other extensions for other enginges. But so far I'm only using velocity... I think treating any file as template (like in your case) also causes superfluous processing overhead (and has the described problems with template processing depending on characters in the file). > (1) I should use different extension for templatized js files. > Is is practicable but I think it is not too nice solution because > standard extension of Java Script files is js. Not other one. Well, at server side the file is not just a js file, it is a template (which creates javascript output). So at least at server side it could (should?) have another extension, to be able to differentiate it from non template files.... that was the reason for my solution described above. Kind Regards, Konstantin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
