users@glassfish.java.net

Re: JSTL Questions

From: <Jan.Luehe_at_Sun.COM>
Date: Fri, 10 Aug 2007 14:42:23 -0700

ITVGuy2000 wrote:

>Well, I don't have any spec issues, or issues with the glassfish
>implementation, its more a how-to kind of question. I am going to post it
>here, since this seems as good a place as any.
>
>On my website, I have hundreds of pages all with the same basic form:
>
><%_at_page contentType="text/html"%>
><%_at_page pageEncoding="UTF-8"%>
><%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
><html lang="en"/>
> <head>
> <meta http-equiv="content-type" content="text/html;
>charset=iso-8859-1"/>
> <link rel="stylesheet" type="text/css"
>href="/design/css/reset.css"/>
> <link rel="stylesheet" type="text/css"
>href="/design/css/mystyles.css"/>
> <title>My Test</title>
> </head>
> <body>
> <div id="container">
> <c:import url="/jspf/header.jspf" context="/design"/>
> <c:import url="/jspf/mainnav.jspf" context="/design"/>
> <c:import url="/jspf/menu-messing.jspf" context="/design"/>
> <div id="contents">
> <h1>This is my test</h1>
> </div>
> <c:import url="/jspf/footer.jspf" context="/design"/>
> </div>
> </body>
></html>
>
>I want to start to do some usage reporting on my website. I would like to do
>this by adding some code in the imported header.jspf, rather than each and
>every page.
>
>My question is this:
>Is there a way for an imported JSP code fragment from a foreign context to
>"know" about the request of the importing page?
>
>

<c:import> is implemented as a RequestDispatcher.include(), which
means that the included resource can tell that is being included
by checking for the presence of any javax.servlet.include.* attributes
in the request (see SRV.8.3.1), irrespective of whether the resource
was included from a foreign or its own context.

Does this answer your question?


Jan

>I'm afraid the answer is that it can't be done, but want to confirm my
>understanding before I try something else.
>
>Thanks,
>
>ITVGuy2000
>
>
>Jan.Luehe wrote:
>
>
>>ITVGuy2000 wrote:
>>
>>
>>
>>>Where should one post questions about using JSTL?
>>>
>>>
>>>
>>>
>>Spec related issues should be sent to users_at_jstl-spec-public.dev.java.net.
>>
>>If you have any questions regarding the impl of the JSTL spec in
>>GlassFish,
>>feel free to use users_at_glassfish.dev.java.net.
>>
>>
>>Jan
>>
>>
>>
>>>Thanks,
>>>
>>>ITVGuy2000
>>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>>
>>
>>
>
>
>