2
I have a jsp page with only two includes in the whole code:
<%@ include file = "../_global/prefixos.jsp" %>
<%@ include file = "../_global/testaProfessor.jsp" %>
In prefixos.jsp
I have the following:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
In testaProfessor.jsp
I have the following:
<jsp:useBean id="validaLogin" class="dao.usuario.TestaLoginUsuario" />
<c:set scope="request" var="usuarioLogado" value="${validaLogin.testaLoginUsuario(pageContext.request)}" />
The <c:set scope="request"
page testaProfessor.jsp
does not have access to <%@ taglib prefix="c"
page prefixos.jsp
What should I do to solve this problem?
EDITION
the answer given by @Bruno César, although it may help in other situations, in the context of my problem does not help.
The case is that if I include a file a within a b, what this in a can be used in b. But that’s not what I need.
What I need is for two files a and b to be included in a file c and for the contents of the file a to be available to the file b as well. Not just the c file.
Any idea?
Example:
index file.jsp
<%@ include file = "../_global/prefixos.jsp" %>
<%@ include file = "../_global/testaProfessor.jsp" %>
I need the contents of prefixos.jsp
be available for testaProfessor.jsp
preixos.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
testaProfessor.jsp
<jsp:useBean id="validaLogin" class="dao.usuario.TestaLoginUsuario" />
<c:set scope="request" var="usuarioLogado" value="${validaLogin.testaLoginUsuario(pageContext.request)}" />
How you are declaring the variable?
– Bruno César
I added data at the end of the question @Bruno César
– Carlos Rocha
You want to take advantage of the taglib statement, that’s it?
– Bruno César
From what I understand... you can include the variable in the request scope, for example:
request.setAttribute("foo", "valorDeFoo");
.– Renan Gomes
@re22 then, that’s what I understood initially. After updating the answer already changed, it seems that he wants to repurpose the taglib statement. Anyway I’ll update a reply.
– Bruno César