简体   繁体   中英

How add Javascript in GVnix/Spring roo project

I'm developing a web application and I want add a js file in my project to use it. I tried to add in this way:

<spring:url value="/resources/scripts/gestion.js" var="gestion"/>
<script src="${gestion}" type="text/javascript"></script>  

The js loads correctly, but the problem is that the page is not showing anything, if I put this code in the end of the jsp file, before of tag <div> the jquery and another js file of the project not work although I can see the content of the jsp.

Somebody can help me with this?

You should include it into src/main/webapp/WEB-INF/tags/util/load-scripts.tagx file.

This tag is used by src/main/webapp/WEB-INF/layouts/default.jspx which is used by Apache Tiles configuration file src/main/webapp/WEB-INF/layouts/layouts.xml to generate the final html output.

Good luck!

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