Yeah: I'm trying to use tomcat as a standalone web server: I managed to
do this fine using apache to host the images: but we don't want to run
both Apache and Tomcat for our web app. { The app is not complex enough
to warrant the extra overhead }

On Tue, 2002-11-19 at 14:46, Georg Hanwalter wrote:
> Do you use tomcat as standalone serving also all static files or do you use tomcat
> together with a webserver like apache or iis. In this take care that your webserver
> knows your webapp-directory for serving the static-files like your images
> 
> Georg
> 
> p niemandt schrieb:
> 
> > Hi: This is getting closer, but somewhere I'm still doing something
> > extremely stupid, I think ...
> >
> > Without the ../ in my url, if I check the logs, I get a 302, Moved kinda
> > thing, but with the ../ I get a 200 ok. The problem is that I still
> > can't see the image.
> >
> > Can the problem be that the file served is called index.shtml, and is
> > not a jsp page?
> >
> > I have tried to both include the request and to forward the request,
> > with the same results.
> >
> > TIA,
> >
> > On Tue, 2002-11-19 at 13:12, Georg Hanwalter wrote:
> > > Hi,
> > >
> > > the problem with relative URL's when using the forward-method of a
> > > request-dispatcher is that the URL's have to be relative to the server-root and
> > > not to the destination page's actual location
> > > e.g. under weapps you have a images-, a JSP and the WEB-INF-directory where your
> > > servlet resides. Now when your servlet forwards to a JSP-page via a
> > > request-dispatcher an the JSP-page contains an image you have to use the URL:
> > >
> > >      ../images/<image-used-in-the-page>
> > >
> > > Georg
> > >
> > > p niemandt schrieb:
> > >
> > > > Thanks Jeff, Steve: Giving me a lot of ideas: Sadly I'm still running
> > > > full speed into mud ...
> > > >
> > > > I have changed the image directory to reside under my WEB-INF folder, do
> > > > I need to configure this in one of the xml files as well? ie.
> > > > application web.xml, or server.xml or something?
> > > >
> > > > I have written a filter that does authentication: It serves the
> > > > index.shtml file, but for some reason I have to specify it as
> > > > WEB-INF\index.shtml to make it work ...
> > > >
> > > > snip ---
> > > >
> > > >         if (!validated) {
> > > >                 // Create the RequestDispatcher
> > > >                 Globals.utility.Log(className,
> > > >                         "doFilter:",
> > > >                         "Forwarding to " + getHtmlResult, 5);
> > > >                 RequestDispatcher rd = config.getServletContext().
> > > >                 getRequestDispatcher( getHtmlResult );
> > > >                 rd.forward( req, res );
> > > >                 return ;
> > > >         }
> > > >
> > > > --- snip
> > > >
> > > > where getHtmlResult is a string I read from a xml file. To make it work
> > > > I need to specify WEB-INF\index.shtml in my xml file.
> > > >
> > > > This then serves the html, but none of my stylesheets or images are
> > > > displayed ...
> > > >
> > > > snip ---
> > > >
> > > >   <link rel="stylesheet" type="text/css" href="style.css">
> > > > <img src="images/logo.gif" alt="Home" width="142" height="60" border="0"
> > > > hspace="0" vspace="0">
> > > >
> > > > --- snip
> > > >
> > > > On Mon, 2002-11-18 at 15:58, Steve Beech wrote:
> > > > > Jeff's right. You're web app is in the folder /servlet so your images should
> > > > > be in /servlet/images - of course I'm assuming you've got images on the
> > > > > index.shtml page and these are the ones you can't see.
> > > > > You only need the one web.xml file (in the WEB-INF folder for your web-app)
> > > > > - a second under images is not required.
> > > > >
> > > > > STeve
> > > > > -----Original Message-----
> > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > > > Sent: 18 November 2002 15:33
> > > > > To: Tomcat Users List
> > > > > Subject: Re: Tomcat 4 StandAlone Web Server, Static HTML and Images
> > > > >
> > > > >
> > > > > Looks like you're basically putting your images in its own web app.  You
> > > > > may need a WEB-INF directory and trivial web.xml file under the images
> > > > > directory in order for Tomcat to like it as a web app (not sure though).
> > > > > Then, I think your url for the image would be "/images/image.gif".
> > > > >
> > > > > Alternatively, you could move your images directory to be within your
> > > > > servlet web app.  Then, your url (from index.shtml) would be
> > > > > "images/image.gif".
> > > > >
> > > > > HTH,
> > > > > -Jeff
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > p niemandt <[EMAIL PROTECTED]>
> > > > > 11/18/02 09:35 AM
> > > > > Please respond to "Tomcat Users List"
> > > > >
> > > > >
> > > > >         To:     Tomcat Users List <[EMAIL PROTECTED]>
> > > > >         cc:
> > > > >         Subject:        Tomcat 4 StandAlone Web Server, Static HTML and
> > > > > Images
> > > > >
> > > > >
> > > > > Hi Group: Please help ...
> > > > >
> > > > > I'm very new to servlets, though I do have a lot of programming
> > > > > experience. My problem is that I can't seem to get images displayed
> > > > > properly using Tomcat as the web server.
> > > > >
> > > > > I have a very simple layout ...
> > > > >
> > > > > webapps
> > > > > /servlet
> > > > >                  index.shtml
> > > > >                  /WEB-INF                -> My servlets and web.xml
> > > > > /images
> > > > >                  contains my images
> > > > >
> > > > > I manage to serve the index.shtml quite easily, my problem is that I
> > > > > can't get the images displayed without specifying the whole url in the
> > > > > form file:///dir/to/images/image.gif, and I think this is wrong.
> > > > >
> > > > > There is a lot of information regarding how to configure a web server to
> > > > > display the images, and this I can do fine, but I would like to only run
> > > > > Tomcat: My site is very small, and the latency in Tomcat would not
> > > > > effect it. My question is in how to specify the url for the image in the
> > > > > html,
> > > > >
> > > > > I have tried "image.gif", "/servlet/image.gif", "../image/image.gif",
> > > > > "/servlet/../image/image.gif", etc, etc.
> > > > >
> > > > > Now I suspect I'm missing something very stupid, but sadly I have no
> > > > > idea what. I do not want to code the image display, as far as I know,
> > > > > Tomcat should be able to handle such a simple html site.
> > > > >
> > > > > My servlets work well, database connectivity and all, and the site works
> > > > > well if I use apache as well, but how to do this without Apache is
> > > > > currently beyond me.
> > > > >
> > > > > Any information or just hints in the correct direction would be greatly
> > > > > appreciated.
> > > > --
> > > > p niemandt <[EMAIL PROTECTED]>
> > > >
> > > > --
> > > > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> > --
> > p niemandt <[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- 
p niemandt <[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to