This is the structure of my project:
src/main/java
-- main.java
src/main/resources
-- webapp
-- -- css
-- -- js
-- -- images
-- -- pages
-- -- -- home.html
Currently, my Maven project utilizes Jersey and Grizzly. I am able to call my REST services and load static HTML pages using clstatichttphandler. The issue arises when the "home.html" file is loaded - the CSS and images do not display. I have attempted to set the path to the CSS relative to the "home.html" file, but it does not seem to be working.
I suspect that my CSS/images are not visible.
EDIT
Below is the file that initiates the Grizzly server - Main.java
public static HttpServer startServer() {
// create a resource config that scans for JAX-RS resources and providers
// in com.application.easyshow package
final ResourceConfig rc = new ResourceConfig().packages("com.application.app", "com.businessLogic");
// create and start a new instance of grizzly http server
// exposing the Jersey application at BASE_URI
HttpServer server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
server.getServerConfiguration().addHttpHandler(
new org.glassfish.grizzly.http.server.CLStaticHttpHandler(Main.class.getClassLoader(), "/webapp/pages/"), "/app");
return server;
}
And here is the <head>
section where I attempt to load my CSS and JS in home.html
<head>
<meta charset="UTF-8">
<title>Soundbyte Template</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/responsive.css">
<link rel="stylesheet" href="../Player/css/progression-player.css" />
<link href="../Player/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href='//fonts.googleapis.com/css?family=Poppins:400,600,700%7cRoboto:400,300,700,900' rel='stylesheet' type='text/css'>
<script src="../js/libs/jquery-1.11.3.js"></script>
<script src="../js/libs/jquery-migrate.min.js"></script>
<script src="../js/libs/modernizr-2.6.2.min.js"></script>
</head>
Overview of my project's appearance