You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Antoni Reus <ar...@ibit.org> on 2001/06/18 13:58:01 UTC

request and jsp:include

Hi, first of all I would like to excuse for my poor english.

I'm using tomcat 3.2.2 in a Win NT 4

I'm trying to do some kinda printing template, so calling de template (
imprimir.jsp )
with a parameter for the page to show it whould display it in a
printer friendly way.

In imprimir.jsp is something like this:

<html>
...
...
<jsp:include page="<%request.getParameter("pagina") %>" />
...
..
</html>

when I call localhost:8080/imprimir.jsp?pagina=listado.jsp
I get a tomcat exception when parsing imprimir.jsp, saying that
pagina has no value.

But if I write imprimr.jsp  this way:

<html>
...
...
<%! String pagina = request.getParameter("pagina");
%>
<jsp:include page="<%=pagina %>" />
...
..
</html>

it works!!

Someone could explain this???


Re: request and jsp:include

Posted by Antoni Reus <ar...@ibit.org>.
I get the error with flush="true" too.

----- Original Message -----
From: "Antoni Reus" <ar...@ibit.org>
To: <to...@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 8:31 AM
Subject: Re: request and jsp:include


> It was an error while typing the email
>
> when I try this in imprimir.jsp:
>
> <jsp:include page="<%=request.getParameter("pagina") %>" />
>
> And call this
http://localhost:8080/imprimir.jsp?pagina=listado_clientes.jsp
>
> I got:
>
> org.apache.jasper.compiler.ParseException:
> E:\tomcat\webapps\ROOT\imprimir.jsp(9,50) atributo pagina no tiene valor
>
> (atributo pagina no tiene valor -> attribute 'pagina' has no value)
>
> ----- Original Message -----
> From: "Jeff Kilbride" <je...@kilbride.com>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, June 19, 2001 12:24 AM
> Subject: Re: request and jsp:include
>
>
> > You're missing an "=" in your jsp:include statement. Try this:
> >
> > <jsp:include page="<%= request.getParameter("pagina") %>" />
> >
> > You have it correct in your second example, which is why that one works.
> >
> > Thanks,
> > --jeff
> >
> > ----- Original Message -----
> > From: "Antoni Reus" <ar...@ibit.org>
> > To: <to...@jakarta.apache.org>
> > Sent: Monday, June 18, 2001 4:58 AM
> > Subject: request and jsp:include
> >
> >
> > > Hi, first of all I would like to excuse for my poor english.
> > >
> > > I'm using tomcat 3.2.2 in a Win NT 4
> > >
> > > I'm trying to do some kinda printing template, so calling de template
(
> > > imprimir.jsp )
> > > with a parameter for the page to show it whould display it in a
> > > printer friendly way.
> > >
> > > In imprimir.jsp is something like this:
> > >
> > > <html>
> > > ...
> > > ...
> > > <jsp:include page="<%request.getParameter("pagina") %>" />
> > > ...
> > > ..
> > > </html>
> > >
> > > when I call localhost:8080/imprimir.jsp?pagina=listado.jsp
> > > I get a tomcat exception when parsing imprimir.jsp, saying that
> > > pagina has no value.
> > >
> > > But if I write imprimr.jsp  this way:
> > >
> > > <html>
> > > ...
> > > ...
> > > <%! String pagina = request.getParameter("pagina");
> > > %>
> > > <jsp:include page="<%=pagina %>" />
> > > ...
> > > ..
> > > </html>
> > >
> > > it works!!
> > >
> > > Someone could explain this???
> > >
> >
>


Re: request and jsp:include

Posted by Antoni Reus <ar...@ibit.org>.
It was an error while typing the email

when I try this in imprimir.jsp:

<jsp:include page="<%=request.getParameter("pagina") %>" />

And call this http://localhost:8080/imprimir.jsp?pagina=listado_clientes.jsp

I got:

org.apache.jasper.compiler.ParseException:
E:\tomcat\webapps\ROOT\imprimir.jsp(9,50) atributo pagina no tiene valor

(atributo pagina no tiene valor -> attribute 'pagina' has no value)

----- Original Message -----
From: "Jeff Kilbride" <je...@kilbride.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 12:24 AM
Subject: Re: request and jsp:include


> You're missing an "=" in your jsp:include statement. Try this:
>
> <jsp:include page="<%= request.getParameter("pagina") %>" />
>
> You have it correct in your second example, which is why that one works.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "Antoni Reus" <ar...@ibit.org>
> To: <to...@jakarta.apache.org>
> Sent: Monday, June 18, 2001 4:58 AM
> Subject: request and jsp:include
>
>
> > Hi, first of all I would like to excuse for my poor english.
> >
> > I'm using tomcat 3.2.2 in a Win NT 4
> >
> > I'm trying to do some kinda printing template, so calling de template (
> > imprimir.jsp )
> > with a parameter for the page to show it whould display it in a
> > printer friendly way.
> >
> > In imprimir.jsp is something like this:
> >
> > <html>
> > ...
> > ...
> > <jsp:include page="<%request.getParameter("pagina") %>" />
> > ...
> > ..
> > </html>
> >
> > when I call localhost:8080/imprimir.jsp?pagina=listado.jsp
> > I get a tomcat exception when parsing imprimir.jsp, saying that
> > pagina has no value.
> >
> > But if I write imprimr.jsp  this way:
> >
> > <html>
> > ...
> > ...
> > <%! String pagina = request.getParameter("pagina");
> > %>
> > <jsp:include page="<%=pagina %>" />
> > ...
> > ..
> > </html>
> >
> > it works!!
> >
> > Someone could explain this???
> >
>


Re: request and jsp:include

Posted by Jeff Kilbride <je...@kilbride.com>.
You're missing an "=" in your jsp:include statement. Try this:

<jsp:include page="<%= request.getParameter("pagina") %>" />

You have it correct in your second example, which is why that one works.

Thanks,
--jeff

----- Original Message ----- 
From: "Antoni Reus" <ar...@ibit.org>
To: <to...@jakarta.apache.org>
Sent: Monday, June 18, 2001 4:58 AM
Subject: request and jsp:include


> Hi, first of all I would like to excuse for my poor english.
> 
> I'm using tomcat 3.2.2 in a Win NT 4
> 
> I'm trying to do some kinda printing template, so calling de template (
> imprimir.jsp )
> with a parameter for the page to show it whould display it in a
> printer friendly way.
> 
> In imprimir.jsp is something like this:
> 
> <html>
> ...
> ...
> <jsp:include page="<%request.getParameter("pagina") %>" />
> ...
> ..
> </html>
> 
> when I call localhost:8080/imprimir.jsp?pagina=listado.jsp
> I get a tomcat exception when parsing imprimir.jsp, saying that
> pagina has no value.
> 
> But if I write imprimr.jsp  this way:
> 
> <html>
> ...
> ...
> <%! String pagina = request.getParameter("pagina");
> %>
> <jsp:include page="<%=pagina %>" />
> ...
> ..
> </html>
> 
> it works!!
> 
> Someone could explain this???
>