0

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?

Mr Lister
  • 45,515
  • 15
  • 108
  • 150

1 Answers1

0

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!

jmvivo
  • 2,653
  • 1
  • 16
  • 20
  • Hi jmvivo, thanks for your answer. I try do what do you advice me, but It's not working. I added in load-scripts.tagx the following code: ` ` The JS file is loaded and the jsp file is showing correctly but don't work the code of js file. I tried put this in load-scripts-bootstrap.tagx but I get the same result – Juan Manuel Barea Martínez Mar 22 '16 at 07:53
  • Try to use Devel tools like FireBug to check that there is no error loading nor running JS code. If a JS error is found the JS execution thread is stopped. – jmvivo Mar 22 '16 at 07:54
  • I've used firebug to search some error, but there aren't, or I didn't see it. The js file load is correctly, after of jQuery js file and my js file load fine because I can see the code in firebug. I don't understand why this not working. Anyway I put my js code directly in jsp ... – Juan Manuel Barea Martínez Mar 23 '16 at 07:48