Hi,
I'm relatively new to
JSF (using JSF 2.0).
I have no problem generating HTML files, but now ran into an unusual situation where I need to dynamically generate a *javascript* file.
Something like:
I'm aware there are other solutions, but I'm not crazy about them:
- inline my javascript inside the HTML page:
- pass 'var a' as a parameter: f(a)
But i'd rather generate a separate (dynamic) javascript file (because our real-life javascript is complex, so the generated HTML would be less readable if we inline javascript into it... and in reality we don't have a single parameter "var a", but dozens of them, which is ugly to pass).
Is it possible to do via JSF?
Or would it be better to make it a
JSP (just for this javascript file)?
Thanks.