users@glassfish.java.net

Re: [Jersey] Pointing web app welcome-file to Jersey Application causes StringIndexOutOfBoundsException

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 16 Apr 2010 11:59:11 +0200

Hi Dominik,

I agree with your assessment. Perhaps GF should fail to deploy in such
circumstances?

Alex, i am not sure what your servlet url pattern is but if it is
something like "/*" you could do something like:

   @Path("/")
   public Root extends OtherResource {
   }

where OtherRootResource is the one root resource you want to point to
for the "root" URL.

If such a URL pattern causes issues because JSPs and static resources
are not accessible use ServletContainer as a filter instead.

Paul.

On Apr 15, 2010, at 8:42 PM, Dominik Dorn wrote:

> hmm... as far as I understand, welcome-files are things that get
> resolved if just
> a directory is specified, like index.html, index.php, etc. and they
> are FILES!
>
> so if you have
> http://localhost:8080/yourapp/
> it will call
> http://localhost:8080/yourapp/index.html
>
> if you create a directory test
> http://localhost:8080/yourapp/test/
> it will call
> http://localhost:8080/yourapp/test/index.html
>
> so, while your mapping of webresources/myresource
> could theoretically work on
> http://localhost:8080/yourapp/
> it would fail on
> http://localhost:8080/yourapp/test/
>
> I think the way specified in your mail is really misusing the
> feature and
> if it works, its a bug in my opinion.
>
> What you are trying to achieve looks like a case for a url-rewriting
> filter like
> http://ocpsoft.com/prettyfaces/ or http://tuckey.org/urlrewrite
>
> kr,
> dominik
>
>
> --
> [url=http://www.dominikdorn.com]Dominik Dorn[/url]
>
> Tausche Deine [url=http://www.studyguru.eu] Lernunterlagen auf
> http://www.studyguru.eu[/url]!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>