RockKhan
RockKhan

Reputation: 13

Netbeans JSF when adding css or javascript error

I import my css file and javascript files in index.xhtml

<script type="text/javascript" src="resource/js/bag.js"></script>

My project works like this in http://localhost:8084/Proje1/ . But when i open http://localhost:8084/Proje1/faces/index.xhtml this url, doesn't work. It doesn't find css file and jquery files. How can i fix this. Thank you.

Upvotes: 0

Views: 78

Answers (1)

cjslv
cjslv

Reputation: 377

Place your resource folder under WebContent, and replace your <script> import with this:

<script src="#{request.contextPath}/resource/js/bag.js"></script>

Upvotes: 1

Related Questions