the problem would be knowing where to insert those lines. You sometimes need
to do things before writing to the output stream(response encoding,etc), so
it can't just go at the top of the file in all cases. This is why the
include is available.

You could use a filter to use RequestDispatcher.include() for all jsps and
append(or prepend) the output from the include and the jsp in your filter.
This of course assumes that you aren't using the included code within the
jsp(custom authentication,logging to db,etc). 

Charlie

> -----Original Message-----
> From: Jan-Michael Ong [mailto:jmong@;adobe.com]
> Sent: Wednesday, October 30, 2002 6:45 PM
> To: Tomcat Users List; Tomcat Users List
> Subject: Re: NEWBIE: Intercepting the jsp request before its 
> written as
> a java file
> 
> 
> Thank you for the quick response. Actually that's the 
> problem. I don't want 
> to have to remember to always insert an include into the jsp file.
> 
> I'd like to modify Tomcat's behavior such that ANY jsp file 
> (preferably in 
> a context) will get these lines added.
> 
> Good point though and I'll keep these in mind.
> 
> Any other suggestions?
> 
> Thanx
> 
> Jan-Michael
> 
> 
> At 03:41 PM 10/30/2002 -0800, [EMAIL PROTECTED] wrote:
> >If I understand your question correctly, why don't you
> >just use one of the include directives to insert that
> >into your file where you want it?
> >
> >Either:
> >
> ><%@ include file="relativeURL" %>
> >
> >-- OR --
> >
> ><jsp:include page="{relativeURL | <%= expression %>}"
> >    flush="true| false" >
> >    <jsp:param name="parameterName"
> >       value="{parameterValue | <%= expression %>}" />+
> ></jsp:include>
> >
> >Thanks.
> >
> >--- Jan-Michael Ong <[EMAIL PROTECTED]> wrote:
> > > Greetings Tomcat-Users Group,
> > >
> > > I tried to search on this topic on Google for a few
> > > days but was unable to
> > > come up with any useful leads.
> > >
> > > I was hoping if any of you would have any idea about
> > > the following:
> > >
> > > For each jsp page, I do the following
> > >
> > > <tag:custom_tag>
> > > do some work
> > > </tag:custom_tag>
> > > other work
> > >
> > > What I would prefer to do is have any jsp page be
> > > rewritten right before it
> > > gets turned into a .java program so that it includes
> > > these lines.
> > >
> > > I've looked at RequestInterceptors and
> > > ContextInterceptors and checked out
> > > the Java 3.2.4 source code ... and while I came up
> > > with some possible leads
> > > its been really hard to figure out if its the best
> > > way to do it or if there
> > > are better ways to accomplish what I'd like to do.
> > >
> > > I would appreciate any help that you can provide in
> > > advance. Thanks very much.
> > >
> > > Sincerely,
> > >
> > > Jan-Michael Ong
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:tomcat-user-help@;jakarta.apache.org>
> > >
> >
> >
> >__________________________________________________
> >Do you Yahoo!?
> >HotJobs - Search new jobs daily now
> >http://hotjobs.yahoo.com/
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> >For additional commands, e-mail: 
> <mailto:tomcat-user-help@;jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to