This is something I've been wanting to do as well - all my users will come
in to http://server, they won't use http://server/app/servlet/app.

I tried using the servlet-mapping method, but the problem with mapping /* or
/ to the turbine servlet is that it's then called to handle all requests,
including files in /images/* and /resources/* (that's why you're seeing it
re-invoke your code for all the images).

You could use HTTP redirect as already suggested, but that's pretty
inefficient for a 'home page'.

I can't think of a way to map everything except '/images' and '/resources'
to the Turbine servlet, but that would be nice.

Maybe if one could map /images/* and /resources/* to the default
file-serving servlet with servlet-mapping, you could then map your turbine
servlet as the default?

I would also like to find a way to disallow directory listings on /images
and /resources...  I think maybe integrating with apache is the only way to
get this level of control.

Jeff


----- Original Message -----
From: "Weaver, Scott" <[EMAIL PROTECTED]>
To: "'Turbine Users List'" <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 6:50 AM
Subject: RE: changing default URL


> > >  thanks for the quick response
> > > I tried ur advice... it did worked.
> > > however, it can no longer see the images/picture files i
> > use in the app. and so does the CSS ive set.
>
> You have 2 options
>
> 1. Use the $content tool to properly format links to static resources like
> css's and images.
>
> <img src="$content.getURI("images/some-image.gif")">
>
> which renders as:
>
> <img src="http://localhost:8080/yourapp/images/some-image.gif";>
>
> or
>
> 2.
>
> This way takes much less work as there is no requirement for the page
> designer to continually use the $content.getURI() over and over again.
>
> Add the "base" tag using content.getURI("") into your <HEAD>
>
> <head>
> ...
>   <base href="$content.getURI("")">
> ...
> </head>
>
> which, when proccessed looks like this:
> <head>
> ...
>   <base href="http://localhost:8080/yourapp/";>
> ...
> </head>
>
> This specifies that everything referenced within the page is relative to
the
> app root and not to it's current location which is the default browser
> behavior.
> So,
>
> <img src="images/some-image.gif"> will always look at
> http://localhost:8080/yourapp/images/some-image.gif
>  regardless of the current path.
>
>
> hth,
> Scott
>
>
> > -----Original Message-----
> > From: Patrice Le Cozler [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 26, 2002 5:03 AM
> > To: Turbine Users List
> > Subject: Re: changing default URL
> >
> >
> > I had the same problem with one of my app (no more images)
> > it seems that when you use url mapping, the portion of the
> > url you type after  http://localhost:8080/myapp/ is ignored
> > ( if you type
> > http://localhost:8080/myapp/images/the-image-you-want-to-displ
> > ay.gif , you always come back to your app
> > home page )
> > I didn't find the way to avoid that. If you find where the
> > problem comes from, I'm interested.
> >
> > Patrice
> >
> > Java Mails wrote:
> >
> > >  thanks for the quick response
> > > I tried ur advice... it did worked.
> > > however, it can no longer see the images/picture files i
> > use in the app. and so does the CSS ive set.
> > >
> > >   Patrice Le Cozler <[EMAIL PROTECTED]> wrote: You just
> > add the following lines in your myapp/WEB-INF/web.xml file
> > > (after the section) :
> > >
> > > myapp
> > > /*
> > >
> > > see
> > >
> > http://jakarta.apache.org/tomcat/tomcat-4.0-doc/catalina/funcs
> > pecs/fs-default.html
> > >
> > > or the Java Servlet specification for more informations
> > >
> > > Patrice
> > >
> > > Java Mails wrote:
> > >
> > > > hi all!
> > > > conventionally, I invoke turbine application using the
> > following URL
> > > > http://localhost:8080/myapp/servlet/myapp
> > > > This can sometimes be long and somehow not very friendly.
> > > > How can I make do it in such a way that I can invoke it using only
> > > > http://localhost:8080/myapp
> > > >
> > > > tia
> > > >
> > > >
> > > > ---------------------------------
> > > > Do You Yahoo!?
> > > > Yahoo! Games - play chess, backgammon, pool and more
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > For additional commands, e-mail:
> > >
> > > ---------------------------------
> > > Do You Yahoo!?
> > > Yahoo! Games - play chess, backgammon, pool and more
> >
> >
> > --
> > 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]>

Reply via email to