Hi Jason,

Am Mi., 24. Okt. 2018 um 14:45 Uhr schrieb Jason E Bailey <j...@apache.org>:

>
>
> On Wed, Oct 24, 2018, at 2:18 AM, Jörg Hoh wrote:
>
> > If we choose that way and want to prefer 1 and 2 we have to educate a lot
> > of people first about the difference between a resource path and a URL
> > pointing to that resource. In 99% all cases I saw in the last decade,
> both
> > scripts and models don't really make a difference between these 2 (and
> let
> > the rewriter handle the difference if any)
>
> Okay, I admit it, I don't understand the distinction here that you're
> trying to make.
>

It's basically 2 things, I see as common patterns:

Resource r = rr.get(SOME_CONSTANT + SOME_OTHER_CONSTANT + "/" +
someVariable);

in different variations, but basically only String concatenation. For me it
doesn't feel good. But that's not related to the rewriter :-)

Secondly, this is often used in this way (JSP):

<a href="<%= r.getPath() %>.html"</a>

In that case the path of the resource is written, but actually it should be
a relative link to another page. Currently the rewriter takes care of such
cases (if the repo path does not match the path part of the URL), but for
many devs the difference is absolutely not clear. That's the reason why I
would opt for some more abstraction and not to (mis-) use the Resource API
for such cases.

HTH,
Jörg

-- 
Cheers,
Jörg Hoh,

http://cqdump.wordpress.com
Twitter: @joerghoh

Reply via email to