I've managed to get the welcome functionality to work the way I want to using the UrlRewriteFilter I mentioned in another post. The default behaviour from Pax-Web does seem very strange though.
/Bengt 2016-11-15 16:10 GMT+01:00 Bengt Rodehav <[email protected]>: > I'm still puzzled with the welcome files. Can't really get it to work. > > My main starting page is: > > http://localhost:8183/index.html > > > If I try to access the above URL everything works. If I instead try to > access: > > http://localhost:8183 > > > I get HTTP status 403. If I try to access: > > http://localhost:8183/ > > > then it changes the URL by removing the trailing "/" and returns 403. > > If I try to access > > http://localhost:8183/admin > > > Then I get back: > > http://localhost:8183/index.html > > > If I try to access > > http://localhost:8183/admin/ > > > then I get 403. > > It doesn't make any sense at all to me. I get the same result regardless > if I manually register welcome files as follows: > > mWebService.registerWelcomeFiles(new String[] { "index.html" }, false, >> mHttpContext); > > > ..or if I just go with the default which I believe is "index.html" and > "index.jsp". > > How should this work? > > Our public site will be mapped to a DNS name (say http://x.y.z) and it is > important that if the user specifies http://x.y.z s/he should get > http://x.y.z/index.html. > > This seems very strange to me. > > /Bengt > > > > > > > > > > > 2016-11-15 13:50 GMT+01:00 Bengt Rodehav <[email protected]>: > >> Thanks Achim, >> >> I didn't know the URL had to end in a "/". >> >> I think it would be a good idea to add the possibility to disable welcome >> file handling. I will try a workaround consisting of setting welcome files >> to files that do not exist, e g: >> >> mWebService.registerWelcomeFiles(new String[] { "nonexistent.html" }, >>> false, mHttpContext); >> >> >> I'm hoping it works. >> >> /Bengt >> >> 2016-11-15 11:15 GMT+01:00 'Achim Nierbeck' via OPS4J < >> [email protected]>: >> >>> Hi, >>> >>> for your first issue of "/admin" this isn't a valid url and therefore >>> the default "index.html" will be executed, if you call "/admin/" which is a >>> valid url, you'll get the index of /admin/index.html ;) >>> >>> Regarding default welcome file handling, this can't be disabled right >>> now. >>> Need to verify if this should be / could be actually possible. >>> >>> Regards, Achim >>> >>> >>> 2016-11-15 11:10 GMT+01:00 Bengt Rodehav <[email protected]>: >>> >>>> I have a couple of issues with welcome files. >>>> >>>> I have some files at the root context, among others an index.html which >>>> is my starting page. I also have a subfolder "/admin" where I have other >>>> types of resources. There is also an "/admin/index.html" which is the >>>> starting page for the administrative user interface. >>>> >>>> If you specify the URL "/admin", the browser is directed to the file >>>> "/index.html" and not "/admin/index.html" that I would have expected. Is >>>> this the way it is supposed to work or do we have a bug? >>>> >>>> I am now using the UrlRewriterFilter for other stuff and might use it >>>> also for welcome files. In that case I want to disable the welcome files in >>>> Pax-Web. But there seems to be no way to do that. I've tried both >>>> >>>> mWebService.registerWelcomeFiles(null, false, mHttpContext); >>>> >>>> >>>> ...and >>>> >>>> mWebService.registerWelcomeFiles(new String[] { }, false, >>>>> mHttpContext); >>>> >>>> >>>> But none of those calls are accepted. >>>> >>>> How can I tell Pax-Web NOT to handle welcome files at all? >>>> >>>> /Bengt >>>> >>>> -- >>>> -- >>>> ------------------ >>>> OPS4J - http://www.ops4j.org - [email protected] >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "OPS4J" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> >>> Apache Member >>> Apache Karaf <http://karaf.apache.org/> Committer & PMC >>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer >>> & Project Lead >>> blog <http://notizblog.nierbeck.de/> >>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> >>> >>> Software Architect / Project Manager / Scrum Master >>> >>> -- >>> -- >>> ------------------ >>> OPS4J - http://www.ops4j.org - [email protected] >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "OPS4J" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> > -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
