i Want to import a given css or javascript file depending os some conditions, in my Servlet i have:
protected void doPost(...)
{
if(condition)
{
//import some javascript or css file here
}
}
I need this behavior since i have too many files to import and the files name may vary according to the condition.
Is it possible?
Sort of, yes.
Then in
page.jspusing JSTLc:if:Update: since you seem to have more than one files for this, you can even make it more flexible by just setting the desired filename suffix (or prefix, or even the entire name, what you like):
and
If you set
suffixto for example"foo", this will loadstyle_foo.cssandscript_foo.js. I think this gives enough new insights.