简体   繁体   中英

JSF 2.0 Ajax and javascript reloading

I use JSF Ajax on my menu links to load the content of the page. content is loaded with ui:insert and ui:composition with template attribute. ajax is work and load the content with no reloadin the all page but I have a problem with my java scripts.

when I click menu Items the script reload with every new ajax request. what should I do to prevent script reloading?

I'm not sure I understood your problem clearly, but maybe you should try to play with the rendered attribute of the h:outputScript component, for instance:

<h:outputScript library="js" name="ajax-util.js" 
                rendered="#{myBean.renderAjaxFunctions}" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM