Marcial Atienzar Navarro wrote:
Hello,
I'm using jstl to make jsp's. I have code structures that are the same for a lot of jsp. I want to make a jsp with this structures, and then import them into the jsp.
The problem that I've encountered is that, in this common jsp I define jstl variables that in the jsp that imports the common jsp I create. Is it possible to do it?
You must set the variables in the request scope in order for them to be
visible by the including page (each page has its own page scope, which
is the scope used when you don't specify one):
<c:set var="numero_filas" scope="request">
<s2k:GetData dataName="filas"/>
</c:set>
Hans
For example:
Common JSP:
<%@ page contentType="text/html" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xml" prefix="x" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c" %>
<%@ taglib uri="/s2ktaglib.tld" prefix="s2k" %>
<c:set var="numero_filas"><s2k:GetData dataName="filas"/></c:set>
<c:set var="fila"><s2k:GetData dataName="fila"/></c:set>
<c:set var="cadena_buscada"><s2k:GetData dataName="cadena_buscada"/></c:set>
Normal JSP
#The sentence to import the common JSP, that I don't know it
.
.
.
<x:param name="NUMERO_FILAS" value="${numero_filas}"/>
<x:param name="FILA" value="${fila}"/>
<x:param name="FILAS_MOSTRADAS" value="${numero_filas_mostradas}"/>
.
.
.
A lot of thanks,
Marcial Atienzar
--
Hans Bergsten <[EMAIL PROTECTED]>
Gefion Software <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at <http://TheJSPBook.com/>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com