I have two JSPF-Files called header.jspf and footer.jspf
header.jspf:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<link rel="stylesheet" href="resources/css/styles.css">
<title>Onlineshop</title>
</head>
<body>
<header>
<hgroup>
<h1 class="title">Onlineshop</h1>
</hgroup>
<nav>
<a href="index.jsp">Home</a>
<a href="register.jsp">Registrieren</a>
<a href="signin.jsp">Einloggen</a>
<a href="sell.jsp">Verkaufen</a>
<a href="search.jsp">Suchen</a>
</nav>
</header>
And my footer.jspf:
<footer>
Copyright
</footer>
</body>
</html>
However, if I want to include them in my other jsp-files, the css file is not working any more. For example I included it like this:
<%@ include file="header.jspf" %>
<form action ="register" method="post">
<fieldset>
<legend>Registrieren</legend>
<table>
......
</form>
<%@ include file="footer.jspf" %>
In the past, all my header and footer code were inside the jsp-files and it was working fine, however after trying to remove the redundant code by including the jspf-files, the css-file is not applied anymore on the jsp-files.