jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [jsr372-experts mirror] Re: Re: Re: Url mapping

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Tue, 11 Nov 2014 18:02:13 +0100

Hi,

On Mon, Nov 10, 2014 at 11:51 PM, Edward Burns <edward.burns_at_oracle.com> wrote:
> Especially when we consider that we could propose something to the
> servlet EG, the broad changes included in this proposal require much
> more refinement and discussion, and prototyping.

I think it does depend a little on how far we're willing to take this.
There seem to be several ideas floating around, all somehow related to
the topic of "mapping". With an increasing level of complexity these
seem to be:

1. Default mapping of FacesServlet to .xhtml
2. Plain extensionless mapping
3. Extensionless mapping + availability of path info
4. Rules based URL mapping with simple pattern based rules
5. Rules based URL mapping with rewrite rules of arbitrary complexity

Option 1. is completely trivial to implement, but really only makes
sense when it's a default mapping.

Option 2. is more involved, but as far as rule processing goes also
trivial, since there's no user provided rule to speak off. It's
completely convention and defaults based. If someone wants a
/book/edit there needs to be a folder "book" with a view "edit.xhtml".

Option 3. is like option 2, but just like Servlets had from day one,
adds the ability to expose the extra paths after the resource mapping.
E.g.:

/foo/bar is requested
/foo/bar.xhtml doesn't exist, but /foo.xhtml does
Instead of sending a 404, use /foo.xhtml, preferably with "/bar" as
request.getPathInfo()

This rather useful feature is known in the Apache HTTPD+PHP world
known as "MultiViews".

Option 4. and especially 5. are slowly getting more complicated. What
syntax do we allow? Only simple name mapping ("foo" maps to "bar") and
simple path to parameter mapping? E.g. /12 becomes userid=12 Or do we
have PrettyFaces/Rewrite-like rules, which if I'm not mistaken are of
nearly arbitrary complexity?

Kind regards,
Arjan Tijms