Understanding url-patterns

2009-12-08 Thread Jonathan Mast
Are URL Patterns ending in a wild card allowed by the Servlet Spec?

I have this pattern setup with the intention of binding every url that
begins with foo to a serlvet
servlet-mapping
servlet-nameMultiFooService/servlet-name
url-pattern/foo*/url-pattern
/servlet-mapping

But http://localhost/foo1, ...foo2, ...fooANYTHING gives me a 404

Only http://localhost/foo* actually resolves to the servlet.

Do I have the syntax wrong?  I seen examples like
url-pattern/*.jsp/url-pattern, so is there some different notation
required for wildcards at the end of the pattern?

Tomcat 6.0.20


Re: Understanding url-patterns

2009-12-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonathan,

On 12/8/2009 11:48 AM, Jonathan Mast wrote:
 Are URL Patterns ending in a wild card allowed by the Servlet Spec?

You could check. You've been on this list long enough to know that the
spec itself is available and quite readable. Maybe it's time to read it.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkseiuIACgkQ9CaO5/Lv0PDi1ACgjDxY0U6PR6b/9zxisLvcIKi5
ADAAn164hq8uQC3UEL/oxh8/qSPFv/pe
=VQ9w
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding url-patterns

2009-12-08 Thread André Warnier

Jonathan Mast wrote:

Are URL Patterns ending in a wild card allowed by the Servlet Spec?

I have this pattern setup with the intention of binding every url that
begins with foo to a serlvet
servlet-mapping
servlet-nameMultiFooService/servlet-name
url-pattern/foo*/url-pattern
/servlet-mapping

But http://localhost/foo1, ...foo2, ...fooANYTHING gives me a 404

Only http://localhost/foo* actually resolves to the servlet.

Do I have the syntax wrong?  I seen examples like
url-pattern/*.jsp/url-pattern, so is there some different notation
required for wildcards at the end of the pattern?

Tomcat 6.0.20

I think you really need to read the corresponding section of the servlet 
specs for that, because these URL patterns are not the same as filespec 
patterns, and not regexpes either.  Their interpretation is really 
java-servlet-specs-specific.

Don't ask why.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding url-patterns

2009-12-08 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonathan,

On 12/8/2009 11:48 AM, Jonathan Mast wrote:

Are URL Patterns ending in a wild card allowed by the Servlet Spec?


You could check. You've been on this list long enough to know that the
spec itself is available 

+1
and quite readable.
+ ... 0.5
 Maybe it's time to read it.
+1

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding url-patterns

2009-12-08 Thread Jonathan Mast
I actually spent an hour and half trying to find the Servlet 2.5 specs and
researching this question in general.  The only thing on Sun's site for
Servlet 2.5 was the Javadocs, not the actual specs.  In fact I even found
other people who had the same issue of not being able to find the Specs as a
PDF.

I have would be tickled to death to be able to read the specs straight from
the source, but since I couldn't find the source, I figured I would ask
another source of information, ie this list.

On Tue, Dec 8, 2009 at 12:25 PM, André Warnier a...@ice-sa.com wrote:

 Christopher Schultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Jonathan,

 On 12/8/2009 11:48 AM, Jonathan Mast wrote:

 Are URL Patterns ending in a wild card allowed by the Servlet Spec?


 You could check. You've been on this list long enough to know that the
 spec itself is available

 +1
 and quite readable.
 + ... 0.5

  Maybe it's time to read it.
 +1


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Understanding url-patterns

2009-12-08 Thread Hassan Schroeder
On Tue, Dec 8, 2009 at 10:32 AM, Jonathan Mast
jhmast.develo...@gmail.com wrote:
 I actually spent an hour and half trying to find the Servlet 2.5 specs and
 researching this question in general.  The only thing on Sun's site for
 Servlet 2.5 was the Javadocs, not the actual specs.  In fact I even found
 other people who had the same issue of not being able to find the Specs as a
 PDF.

??? Google: 'servlet spec download'

Hint: it's the first hit.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding url-patterns

2009-12-08 Thread Kris Schneider
On Tue, Dec 8, 2009 at 1:32 PM, Jonathan Mast
jhmast.develo...@gmail.com wrote:
 I actually spent an hour and half trying to find the Servlet 2.5 specs and
 researching this question in general.  The only thing on Sun's site for
 Servlet 2.5 was the Javadocs, not the actual specs.  In fact I even found
 other people who had the same issue of not being able to find the Specs as a
 PDF.

 I have would be tickled to death to be able to read the specs straight from
 the source, but since I couldn't find the source, I figured I would ask
 another source of information, ie this list.

http://java.sun.com/products/servlet/reference/api/index.html

-- 
Kris Schneider

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding url-patterns

2009-12-08 Thread André Warnier

Jonathan Mast wrote:

I actually spent an hour and half trying to find the Servlet 2.5 specs and
researching this question in general.  The only thing on Sun's site for
Servlet 2.5 was the Javadocs, not the actual specs.  In fact I even found
other people who had the same issue of not being able to find the Specs as a
PDF.

I have would be tickled to death to be able to read the specs straight from
the source, but since I couldn't find the source, I figured I would ask
another source of information, ie this list.


Independently of the other answers, just 2 notes :

1) probably the reason why nobody wants to give you another answer than 
to read the specs, is that when you will have read the specs about the 
URL wildcards, you will not only have your answer, but also be somewhat 
puzzled yourself as to why the specs writers had to go and re-invent yet 
another way of doing wildcards all for themselves.
You would thus probably not believe it if we just told you, so it is 
better if you read the original specs. They are, after all, the specs, 
and Tomcat has to abide by them.


2) Even apart from that, and even for non-specifically-Java types like 
me, the specs are more or less readable, and the parts that are readable 
are very enlightening for anyone having to deal with Tomcat (or servlet 
servers in general).  So the gurus here are actually trying to do you a 
favor by forcing you to go read them.
The additional benefit is that the next time someone on this list asks a 
question that is clearly non-sensical and/or in contravention of the 
specs, you will be able to tell them : read the servlet specs.

Makes you immediately sound like a pro.
;-)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding url-patterns

2009-12-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 12/8/2009 1:54 PM, André Warnier wrote:
 Independently of the other answers, just 2 notes :
 
 1) probably the reason why nobody wants to give you another answer than
 to read the specs, is that when you will have read the specs about the
 URL wildcards, you will not only have your answer, but also be somewhat
 puzzled yourself as to why the specs writers had to go and re-invent yet
 another way of doing wildcards all for themselves.

Yeah, I'm surprised they didn't go with either standard globbing rules
(* = anything, ? = any one thing) or with regular expressions (which can
be somewhat inaccessible). The whole it looks like a glob but it's only
a very special case of a glob is pretty irritating.

I just checked, and this foolishness is still in effect for the proposed
3.0 specification.

 The additional benefit is that the next time someone on this list asks a
 question that is clearly non-sensical and/or in contravention of the
 specs, you will be able to tell them : read the servlet specs.
 Makes you immediately sound like a pro.

Or an ass. Sometimes the two are interchangeable. :)

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkseq2wACgkQ9CaO5/Lv0PDlIACaAmVnLpWIohItFZ+P957/ZePB
yxAAn12zWcCYScA0FJEjbPpe15guEt8Q
=87sb
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org