- Create a folder with name of your site, e.g. If your site that you're currently working on is named as
Hello_World
so your folder should also be named asHello_World
and be placed underJSK_Installation_Path\App_Server\apache-tomcat-7.0.42\Sites\webapps\cs
- Place all the static assets like
.js
,.css
or image / other files within this folder. - We can create a reference path to these files using
request.getContextPath()
:<link rel="stylesheet" href='<%=request.getContextPath() + "/Hello_World/css/home.css" %>'> <script src='<%=request.getContextPath() + "/Hello_World/js/home.js" %>'> <img src='<%=request.getContextPath() + "/Hello_World/img/home.jpg" %>'>
Last active
April 4, 2020 16:38
-
-
Save aakash14goplani/f5cc93b5552ba34fbe5c979d6ec3ad01 to your computer and use it in GitHub Desktop.
Referencing static files in JSK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment