From: <web...@ap...> - 2003-08-09 03:24:53
|
I want to pass parameters as paths but I do not want to use mod_rewrite. It works for php or Spyce where instead of http://localhost/index.php?param1¶m2 I can use http://localhost/index.php/param1/param I would like to do the same with WebKit but http://localhost/WK/MyContex/index.py/param1/param2 does not work as I expected (index.py is not recognized as file to be parsed). Is there any way to fix it? |
From: Nick M. <ni...@go...> - 2003-08-09 10:42:03
|
Jarosław Zabiełło wrote: > I want to pass parameters as paths but I do not want to use > mod_rewrite. > > It works for php or Spyce where instead of > http://localhost/index.php?param1¶m2 > I can use > http://localhost/index.php/param1/param > > I would like to do the same with WebKit but > http://localhost/WK/MyContex/index.py/param1/param2 > does not work as I expected (index.py is not recognized as file to be > parsed). Is there any way to fix it? Set ExtraPathInfo to 1 in Application.config. |
From: deelan <de...@in...> - 2003-08-10 16:02:47
|
Nick Murtagh wrote: >> I would like to do the same with WebKit but >> http://localhost/WK/MyContex/index.py/param1/param2 >> does not work as I expected (index.py is not recognized as file to be >> parsed). Is there any way to fix it? > > Set ExtraPathInfo to 1 in Application.config. i'm too experimenting with extrapathinfo. i have a context named "weblog" and an "index" servlet on my dev machine, the URL lokks like: http://akira/WK/weblog/index/param1/param2/ in the console i can see the extra path info using self.request().extraURLPath(): /param1/param2/ however there's an unwanted side-effect, in my generated page i have some relative URL, e.g. a couple of CSS files, included in the HTML code with: <style type="text/css">@import url("styles/weblog.css");</style> the problem is that webware searches for such CSS files under the /param1/param2/ folders (of course both are fictional): /WK/weblog/index/param1/param2/styles/print.css obviously the CSS are not imported and then the page looks unstyled. for various reasons i cannot use absolute paths for resources. is this the intentended behavior? instead should webware strip extrapathinfo from request URL prior to start serving resources to the client? i'm using apache 2, webware 0.8.0 and python 2.2.2 thanks in advance. later, deelan |
From: Randall R. <ra...@ra...> - 2003-08-12 00:04:05
|
On Sunday, August 10, 2003, at 06:40 AM, deelan wrote: > > the problem is that webware searches for such CSS files > under the /param1/param2/ folders (of course both are > fictional): > > /WK/weblog/index/param1/param2/styles/print.css > > obviously the CSS are not imported and then the page > looks unstyled. > > for various reasons i cannot use absolute paths > for resources. is this the intentended behavior? > instead should webware strip extrapathinfo from request > URL prior to start serving resources to the client? How would it know where to find it, then? If it found index, it would have to use index.py and pass the print.css to it in the pathinfo, no? One solution might be to have your SitePage look for ".css" in the pathinfo, and if it's there, do something other than the normal writeHTML stuff to send back a stylesheet instead. This seems like it would do what you want. -- Randall Randall <ra...@ra...> "Not only can money buy happiness, it isn't even particularly expensive any more." -- Spike Jones |
From: Nick M. <ni...@go...> - 2003-08-12 08:24:27
|
deelan wrote: > however there's an unwanted side-effect, in my generated > page i have some relative URL, e.g. a couple of CSS files, > included in the HTML code with: > > <style type="text/css">@import url("styles/weblog.css");</style> > > the problem is that webware searches for such CSS files > under the /param1/param2/ folders (of course both are > fictional): > > /WK/weblog/index/param1/param2/styles/print.css > > obviously the CSS are not imported and then the page > looks unstyled. > > for various reasons i cannot use absolute paths > for resources. is this the intentended behavior? > instead should webware strip extrapathinfo from request > URL prior to start serving resources to the client? Relative URLs are converted into absolute ones by the web browser. So there is nothing Webware can do about this. Nick |
From: Stephan D. <ste...@gm...> - 2003-08-12 09:01:41
|
On Tuesday 12 August 2003 10:24, Nick Murtagh wrote: > deelan wrote: > > however there's an unwanted side-effect, in my generated > > page i have some relative URL, e.g. a couple of CSS files, > > included in the HTML code with: > > > > <style type="text/css">@import url("styles/weblog.css");</style> > > > > the problem is that webware searches for such CSS files > > under the /param1/param2/ folders (of course both are > > fictional): > > > > /WK/weblog/index/param1/param2/styles/print.css > > > > obviously the CSS are not imported and then the page > > looks unstyled. I've solved this kind of problem with the html header directive: <base href="http://my.base.path"> Of course, you can't use relative urls then in your application (if this is a problem at all) stephan |
From: david e <bb...@fa...> - 2003-08-12 09:14:31
|
Regarding extrapath urls. Any suggestions on how to handle "path info" with data containing slashes. Like, /zipcode/12345/name/n/a/ Ok, one way would be if I know all possible keys and use them to separate the values. Any other tricks? /d |
From: Nick M. <ni...@go...> - 2003-08-12 09:33:16
|
david e wrote: > Regarding extrapath urls. Any suggestions on how to handle "path info" > with data containing slashes. > > Like, /zipcode/12345/name/n/a/ >>> import urllib >>> urllib.quote_plus('n/a') 'n%2Fa' >>> urllib.unquote('n%2Fa') 'n/a' |