On Fri, Jun 7, 2019 at 10:13 AM André Warnier (tomcat) <a...@ice-sa.com> wrote:
> On 07.06.2019 08:31, Rob Nikander wrote: > > > > > >> On Jun 6, 2019, at 5:19 PM, André Warnier (tomcat) <a...@ice-sa.com> > wrote: > >> > >> On 06.06.2019 13:28, Konstantin Kolinko wrote: > >>> чт, 6 июн. 2019 г. в 10:32, Rob Nikander <rob.nikan...@gmail.com>: > >>>> > >>>> […] > >>> > >>> 1. Exact version number of Tomcat =? Does it support that attribute? > > > > Version 9.0.20. > > > > Thank you both for the recommendations and warnings. At the moment I’m > not sure what I’ll do. > > > > I often don’t think of URL paths like directories, but if I do that, > then it makes some sense to redirect. But in my case, the url “/myapp” is > the entry point to my web app, and it currently returns an intro page, not > something that looks like a directory listing. Once you get into the app it > has other URLs like /myapp/login, /myapp/browse, /myapp/practice, etc. I > don’t have a great reason for disliking the slash; it’s mainly subjective > preference of thinking the URLs without slash look simpler and cleaner. > > > > Maybe my best “reason” to do this is that the minimal base URL /myapp is > the obvious entry point to the app, and my first choice to give out to the > public as the app’s location, so I want it to work as fast as possible, > without a redirect. > > > > What I was trying to say, is that the redirect is needed so that *the > browser* would have > the correct URL for the page it is ultimately obtaining, so that *the > browser* can > correctly interpret any relative URLs which may exist in that page (and > cookie paths etc..). > Yes, I think understood what you were saying there about relative URLs. Even if I use the slashless URL, I'm glad you explained it because now I know why Tomcat is working that way. I think it my case it's not that difficult to change which URL I consider canonical, redirect /myapp/ → /myapp, and deal with URLs and cookies accordingly. I need to change the defaults with cookies anyway since I want a site-wide session, not something restricted to /myapp. Most of the app is served from other URLs, like /myapp/login, /myapp/practice, etc., where this is not a factor. I already avoid relative URLs for some other reasons -- for example, they become extra confusing in apps like this which programmatically create UI components that can be reused on different pages/URLs, and which use the HTML5 history API (changes to the URL don't always result in server page requests). Rob