Is it possible to include all javascripts files from one folder in JSF?

前端 未结 2 1363
Happy的楠姐
Happy的楠姐 2021-02-10 14:37

I am using JSF 2.0, and am looking for a means to include all the javascripts from a given folder on a page, i.e. do something like



        
2条回答
  •  梦如初夏
    2021-02-10 15:10

    I didn't test this, but if wildcards are not accepted, you could fetch the filelist via java code in a backing bean, and insert them into head using c:forEach or ui:repeat like:

    
        
    
    

    Note that you cannot give absolute paths to h:outputScript but you must extract the prefix from them (the part the preceeds the JSF resources path).

提交回复
热议问题