I think that there is a way to have servlets output JSP pages but I can't
remember what it is. Plus, since it's dynamic and the JSP will change
everytime you have to wait for the server to create the page, compile it, and
then show it. You loose all performance features of JSP.
I would probably create a package for your company (or whatever you want) which
holds common header information. This way you can organize it to include
headers for the company, each department, whatever. Then you can call this
from whatever servlet you want. If you change the header you don't have to
recompile every serlvet that uses it.
An even better way would be to create a utility to read a html file, sort of
like what you have, except that it wouldn't be hard coded. Then you could call
something like
"out.print(CompanyName.HTTPUtilities.getHeader(/path/CompanyHeader.htm))"
This way you can have your advertising dept (or whatever) change the file as
much as they want without recompiling it. Also, you don't have to imbed all
the file processing logic in every serlvet.
Hope some of this is useful,
Matt
Quoting "BENARD Christophe, DDE 34/SG" <[EMAIL PROTECTED]>:
> Hi gurus,
>
> Maybe I'm taking the bad way to do it, but what I want to do is to
> include a
> header file (which displays the name of the company, the date, the name
> of
> the user, etc) in a page generated by a servlet.
>
> If I try to input the file using a out.println("<%@ include
> file='TheNameOfMyHeaderFile.jsp'%>").
>
> The result is a page which display <%@ include
> file='TheNameOfMyHeaderFile.jsp'%> at the top of my "servlet" page. I
> can
> easily imagine why it doesn't work, but I don't know any better way to
> do
> it.
>
> Any idea or suggestion would be appreciated.
>
> TIA
>
> Chris
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
> http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html