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

[jsr372-experts] Re: [1359-views] DISCUSSION

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Mon, 2 Mar 2015 20:54:36 +0100

Hi Arjan,

> Am 01.03.2015 um 20:50 schrieb arjan tijms <arjan.tijms_at_gmail.com>:
>
> Hi,
>
> On Sun, Mar 1, 2015 at 6:11 PM, Frank Caputo <frank_at_frankcaputo.de> wrote:
>
>> We can send a 403 if there is no f:view tag in the requested facelet.
>
> A 404 is probably better, as a 403 reveals the existence of the file.
> E.g. it lets an attacker find out there's an /admin/panel, which is
> information that might be used in other attacks.

OK. I’ve seen arguments for both 403 and 404.

>> I have another point about extensionless mapping. If the main purpose is SEO, than this only helps for english web sites. Most projects I have seen In Germany usually use english as the technical language. So all facelets have english names. But for SEO they need german URLs.
>
> True, as a Dutch user having previously worked on a product
> exclusively targeting the Dutch market we were pretty much in the same
> boat.
>
> As a matter of fact the proposed solution is indeed very bare bones.
> As I think I mentioned before, I can see how some users may be
> disappointed by such an overly simple solution. It's perhaps not
> entirely unlike resource contracts which eventually was a rather
> watered down version of the initial "promise" of multi-templating and
> skinning, but at least we got that (the alternative would be to have
> had nothing at all for 2.2).

The initial promise was not generic enough and to restrictive for the spec. It was a good idea to be built on top of JSF. Resource Library Contracts is the generic solution which is an „enabler“ for any skinning solution on top of JSF.

> The point is that obviously big features which require a lot of design
> and spec work are hard to get into JSF these days.

I don’t hink, this is true. I know the discussions in the EG are sometimes a little bit annoying, but they ensure, that we don’t close the door for the future. From my point of view only generic features should make it into the spec. That’s why I tell all my customers: Use JSF! You can do whatever you want, because it is so generic.

> We're some 7 months
> into the 2.3 spec cycle now and there hasn't been much agreement on
> any more advanced solution, plus several parties have indicated that
> resources are an issue.

I also think there is a resources issue. But I’m pretty sure Ed and Manfred welcome big contributions from you.

> This simple solution is not all encompassing, I know that. But it's
> something that gets the ball going IMHO and should be relatively
> simple to implement and spec. Basic use cases are covered, and users
> and/or libraries can then build on it to support more advanced
> scenarios.
>
>
>> I believe it is the same for many other countries. Are there any other use cases for extensionless mapping?
>
> There are quite a lot of websites that appeal to an international
> audience, and most if not all of them use extensionless mappings these
> days with English URLs:
>
> For example:
>
> * stackoverflow.com/questions
> * stackoverflow.com/users/login
> * reddit.com/prefs
> * reddit.com/message/inbox <http://reddit.com/message/inbox>

reddit is a good example for bad SEO with english URLs in german. If you search for "reddit vergoldet“ in german the first hit is some kind of comments. The second hit is reddit.com/gilded <http://reddit.com/gilded>, which should be the first hit.

> * facebook.com/login
> * tumblr.com/login
> * etc
>
> And of course our own showcase:
>
> * showcase.omnifaces.org/whatsnew
> * showcase.omnifaces.org/cdi/Eager <http://showcase.omnifaces.org/cdi/Eager>
> For all these use cases the proposed solution would work fine. For per
> region localization of URLs an other solution would have to be used,
> e.g. PrettyFaces.

I’d like to have a solution, which can be easily used by the developer.

Maybe we can have a Java-API. E.g. Application.addView(String mapping, String faceletPath), which is automatically called by JSF with the discovered (no matter how they are discovered) views and the default mapping, which is the extensionless facelet path. This can be overridden by the developer to change the mapping.

IMO it is important to design new features as generic as possible and let developers customize them.

Ciao Frank