0
Good night,
I’m having a weird problem, I’m trying to display images, map CSS and JS in jsp and it’s not working, it just doesn’t, the weirdest thing is that I’m using the c:url tag of "jstl/core" and I tried to use ${pageContext.request.contextPath} and it didn’t work.
I am using simple Servlet without any framework.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>clientes atuantes</title>
<link rel="stylesheet" href="<c:url value="/bootstrap/css/bootstrap.min.css"/>">
<link rel="stylesheet" href="<c:url value="/css/layout.css"/>">
<script type="text/javascript" src="<c:url value="/bootstrap/js/jquery-1.12.0.js" />"></script>
<script type="text/javascript" src="<c:url value="/bootstrap/js/bootstrap.min.js" />"></script>
</head>
<body>
<main>
<div class="col-md-12">
<div class="panel panel-default espacamentoExterno5">
<div class="panel-body">
<p><img src="<c:url value="/img/ativo.gif"/>" /> ativo</p>
<p><img src="<c:url value="/img/congelado.gif"/>" /> congelado</p>
<p><img src="<c:url value="/img/cancelado.gif"/>" /> cancelado</p>
</div>
</div>
</div>
</main>
</body>
someone knows what might be going on?
Hello, welcome to [en.so]! Could you edit your question with the directory structure of your application? You may be putting the files in the wrong place.
– utluiz
It seems that you are not escaping the quotes. Try
<img src="<c:url value=\""/img/designado1.gif\""/>"/>
– Renan Gomes
put the structure
– Bandoleiro
Try to put
../
level up in the folder. An example: <img src="<c:url value=".. /img/active.gif"/>" />– Marconi
None of your options solved
– Bandoleiro
@Bandoleiro has an error in the console? F12-> console. It also tries to take out the <c:url value= you don’t need. Another idea, try to put <img src=".. /.. /img/active.gif"/>" />
– Marconi
tb didn’t work
– Bandoleiro
Guys, I have no idea what I can do to fix this
– Bandoleiro