How to include a file in the following folder WEB-INF\includes\header.js in jsp using tomcat. I have the included the following in jsp file but it does not work "
<script type="text/javascript" src="WEB-INF/includes/header.js"></script>
". It is not getting the header.js and when i view source and try to click on the src link it says resource not found 404 error.
How to include a file in the following folder WEB-INF\includes\header.js in jsp using tomcat. I have the included the following in jsp file but it does not work "
<script type="text/javascript" src="WEB-INF/includes/header.js"></script>
". It is not getting the header.js and when i view source and try to click on the src link it says resource not found 404 error.
Share Improve this question edited Nov 24, 2012 at 15:12 Sazzadur Rahaman 7,1161 gold badge32 silver badges53 bronze badges asked Dec 5, 2011 at 20:30 Abdus SamadAbdus Samad 3533 gold badges13 silver badges29 bronze badges2 Answers
Reset to default 4Put a "/"
before "WEB-INF"
like this,
<script type="text/javascript" src='<c:url value="/WEB-INF/includes/header.js"/>'></script>
and it will work fine. :)
<script type="text/javascript">
<%@include file="../foo.js" %>
</script>
foo.js is under WEB-INF/jsp and the file include it is under WEB-INF/jsp/mon
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745101296a4611289.html
评论列表(0条)