8
I have the following situation:
Servlet instantiated at the root
/Minhaservlet
Jsp instantiated in a folder inside the root:
/folder/file.jsp
Inside that file I have the following
<img src="_img/editar.png">
<a href="_global/topoErro.jsp">Editar</a>
<jsp:include page="_global/topoErro.jsp" /> </div>
Note that both the image and the href link are pointing to folders that are at the root of the application but should be with .. / before this file is in /folder as well as /_img and /_global.
My question is why jsp include gives error when using the same way as href if the files that are in href and the file that is in jsp include are the same?
_global,
_img
These are folders that are at the root! And my Servlet is also noted at the root
@WebServlet(
name="MinhaServlet",
urlPatterns={"/MinhaServlet"}
)
No mention on the web.xml
In my project it looks like this: Here I am having problems to paste. erro404.jsp
<jsp:useBean id="constantes" class="util.Constantes" />
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="_global/_css/estiloSite.css" />
<title>${constantes.tituloSite}</title>
</head>
<body class="fadeIn">
<div id="topo"> <jsp:include page="../_global/topoErro.jsp" /> </div>
<div id="meio"> <jsp:include page="erro404Conteudo.jsp" /> </div>
<div id="mapa"> <jsp:include page="../_global/mapaErro.jsp" /> </div>
<div id="creditos"> <jsp:include page="../_global/creditosErro.jsp" /> </div>
</body>
</html>
erro404Conteud
<div id="central">
Esta página não existe! <br/>
Código do Erro : ${statusCode} <br/>
<img src="_img/editar.png">
<a href="_global/topoErro.jsp">Editar</a>
<jsp:include page="_global/topoErro.jsp" />
</div>
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero