Re: D2W and Direct Actions
Re: D2W and Direct Actions
- Subject: Re: D2W and Direct Actions
- From: Denis Frolov <email@hidden>
- Date: Sun, 3 Jun 2007 12:20:01 +0400
On Jun 1, 2007, at 10:08 PM, Mike Schrag wrote:
And the second question: how did you do the URL creation? I'm
still looking for a good way of creating "nice" URLs. I'm
absolutely no Apache specialist, I know it's the WebServer used on
Mac OS X Server ... okay, no kidding, I know a bit but not nearly
enough. Over the time I saw a couple of interesting approaches for
nicer URLs but I haven't decided to use one of them for my own
apps ...
We do a LOT of stuff with Apache rewrite rules on our apps ... A
few months back I added some things into to Wonder to make the WO
side a little easier. If you override ERXApplication_rewriteURL
(String url), you can write the "formatter" and in apache rewrite
rules, you write the "parser".
So for instance, we have like http://www.oursite.com/wa/someAction?
id=whatever
I only leave the /wa/ as a tiny shout-out to WO. So my _rewriteURL
method can rip apart the URLs and make everything look like that
(well, for da's, -- otherwise it's /wo/0.4.3.2.5 whatever), then my
rewrite rule looks like:
RewriteRule ^(/-{0,1}[0-9]*/*(wo|wr|wa|womp|wis|ajax)/.*)$ /cgi-bin/
WebObjects/OurApp.woa$1 [PT]
We do the same thing, except /wa/ is considered default one, so
direct action urls look like http://myhost.com/DirectActionClass/
directAction
In this case you also need a rewrite rule not to rewrite rules to web
server resources, e.g. /images/, etc, but urls are a bit cleaner.
--
Denis Frolov
Design Maximum MA
Tel: +7 863 2648211
Fax: +7 863 2645229
Web: http://www.designmaximum.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden