1) the webware WorkDir should not be in the web path.
Only put the WebKit.cgi or OneShot.cgi in the cgi-bin .
There should be no way for a browser to request a page directly.
So http://mymachine/webware_location/SitePage should be
http://mymachine/WebKit.cgi/frontend/
2) I agree w/ the basic error page, see line 373 of WebKit/Application.py
def handleBadURL(self, transaction):
res = transaction.response()
res.setHeader('Status', '404 Error')
## res.write('<p> 404 Not found: %s' % transaction.request().uri())
res.write(self._404Page % (transaction.request().uri()))
# @@ 2000-06-26 ce: This error page is pretty primitive
# @@ 2000-06-26 ce: We should probably load a separate template file and display that
As a simple fix I use a 404.txt w/ a client side redirect. But that is primative also because I lose any request parameters, but
thats not a big problem because I <i> never</i> type a link wrong.
BTW Webware looks for the 404.txt in the working dir first and then uses the one under WebKit.
Thanks,
-Aaron
----- Original Message -----
From: "Costas Malamas" <costasm@...>
To: <webware-discuss@...>
Sent: Wednesday, December 12, 2001 2:40 PM
Subject: [Webware-discuss] Cleaning up AppWorkDir and better 404 handling...
> Hi all,
>
> Coupla questions:
>
> I have a fairly largish python package for which WebWare acts as its
> frontend. Thus my package is structured like this:
> /package
> /sub-package1
> /sub-package2
> /frontend
>
> I put all the Webware-specific stuff under /frontend, incl. my SitePage, and
> run the createAppWorkDir (?) script for /frontend. Everything worked out of
> the box and that's cool, but now a browser can hit
> http://mymachine/webware_location/SitePage and get a page (a blank one, but
> still a page). I know I am being ...er... detail-oriented, but I don't like
> that. What's the best way to handle this? how do y'all usually setup
> installations? Should I put the WK classes under another sub-package and
> import them instead?
>
> Secondly, I am kinda disappointed in the way WebKit handles 404s. A simple
> text message isn't enough I think: I'd like to provide a search page or a
> good guess at what the user was trying to get at. I could batch-create a
> static 404 page and save it as 404text.txt, but that detail-orientation
> again :-)... Is it possible that Application.py tries to serve a 404Page
> (possibly set in Application.config) before defaulting to 404text.txt? In
> the same vain, I'd like an error page caused by an exception to go to a Page
> class if possible (I know this may not work if the exception is in SitePage)
> instead of the default traceback page.
>
> I'd be happy to start hacking away and add these features, if someone can
> gimme some starting hints (WK internals mostly go over my head still).
>
> Anyways, thanks in advance --just the fact that after weeks of working on
> WK, I only find cosmetic stuff to nitpick on says something about Webware
> :-)...
>
> C.
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> _______________________________________________
> Webware-discuss mailing list
> Webware-discuss@...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
|