I don't know why installPatches() didn't bring the change. Although I'm using 
Wonder's latest stable release so the change mentioned in the WONDER-389 should 
be reflected.

However, I did my work around and thought to share with you as I found it to be 
flexible and dynamic and perhaps wonder team could implement something like 
this. I've overridden the method dispatchRequest() in my application as follows:

@Override
public WOResponse dispatchRequest(WORequest request) {
        WOResponse response = super.dispatchRequest(request);
        String _replace = request.stringFormValueForKey("_alias");
        if(response.contentString() == null || _replace == null || 
_replace.trim().length() == 0) {
                return response;
        }
        String _pattern = 
request._uriDecomposed().prefix().concat("/").concat(request._uriDecomposed().applicationName().concat(".woa"));
        response.setContent(response.contentString().replaceAll(_pattern, 
_replace));
        return response;
}

And defined following rewrite rules:

RewriteRule ^/app/(.*)$ 
/Application/WebObjects/MyApplication.woa/$1?_alias=/app [L,PT,QSA]
RewriteRule ^/xyz/(.*)$ 
/Application/WebObjects/MyApplication.woa/$1?_alias=/xyz [L,PT,QSA]
RewriteRule ^/abc/(.*)$ 
/Application/WebObjects/MyApplication.woa/$1?_alias=/abc [L,PT,QSA]

Now my application be accessed with three different aliases /app, /xyz and /abc 
and the response contains the corresponding rewritten url. No need to set the 
properties in the Properties for pattern and replace as that can be directly 
controlled with apache config file.

However, I would like to know I've implemented this change at right place or 
there is any other method which more appropriate such as _rewriteURL but that 
is still not working for me.

Farrukh

On 2010-06-25, at 4:54 PM, Kieran Kelleher wrote:

> Probably true.
> 
> On Jun 25, 2010, at 9:44 AM, Farrukh Ijaz wrote:
> 
>> Thanks once again.
>> 
>> I do not disagree with you however I think I'm missing the patch pointed out 
>> by our CTO.
>> 
>> http://issues.objectstyle.org/jira/browse/WONDER-389
>> 
>> Farrukh
>> 
>> On 2010-06-25, at 4:37 PM, Kieran Kelleher wrote:
>> 
>>> Try replace "cgi-bin" in my example with "Application" - modrewrite is just 
>>> transforming URLs - I don't think it cares whether a part of the URL points 
>>> to Tomcat or WOadaptor.
>>> 
>>> Fundamentally your rewrite rules syntax is different to my rules that are 
>>> working. So try copying the pattern of the working rewrite rules and see 
>>> what happens.
>>> 
>>> 
>>> On Jun 25, 2010, at 9:08 AM, Farrukh Ijaz wrote:
>>> 
>>>> Hi Kieran,
>>>> 
>>>> Thanks for the immediate response.
>>>> 
>>>> Is your instance running on Tomcat or any J2EE Server as SSDD or WAR? If 
>>>> not, then the rules mentioned below does not help as in SSDD or WAR there 
>>>> is no concept of /cgi-bin/ which is the game of mod_WebObjects.so in this 
>>>> case.
>>>> 
>>>> Farrukh
>>>> 
>>>> On 2010-06-25, at 3:51 PM, Kieran Kelleher wrote:
>>>> 
>>>>> Your rewrite rules are not complete, here is what I have in a working 
>>>>> deployment:
>>>>> 
>>>>>   # Shorten the WebObjects URLs to MyApplication
>>>>>   RewriteRule ^/app/(.*)$ /cgi-bin/WebObjects/MyApplication.woa/$1 
>>>>> [NC,PT,L]
>>>>>   RewriteRule ^/app$ /cgi-bin/WebObjects/MyApplication.woa [NC,PT,L]
>>>>> 
>>>>> 
>>>>> er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/WebObjects/MyApplication.woa
>>>>> er.extensions.ERXApplication.replaceApplicationPath.replace=/app
>>>>> 
>>>>> 
>>>>> On Jun 25, 2010, at 8:44 AM, Farrukh Ijaz wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> RewriteRule /AppShortName(.*) /Application/WebObjects/Application.woa$1 
>>>>>> [L, PT, QSA]
>>>>>> 
>>>>>> When I access the application using /AppShortName in the browser, 
>>>>>> /AppShortName remains in the browser url address bar. However the 
>>>>>> generated response source code contains links with 
>>>>>> /Application/WebObjects/Application.woa. So if I click any link it 
>>>>>> changes the URL in the browser from /AppShortName to 
>>>>>> /Application/WebObjects/Application.woa
>>>>>> 
>>>>>> How can I make my application to replace the 
>>>>>> /Application/WebObjects/Applicaation.woa to /Application ?
>>>>>> 
>>>>>> I looked into the following properties:
>>>>>> 
>>>>>> er.extensions.ERXApplication.replaceApplicationPath.pattern=/Application/WebObjects/Application.woa
>>>>>> er.extensions.ERXApplication.replaceApplicationPath.replace=/AppShortName
>>>>>> 
>>>>>> But the above works only if the pattern is 
>>>>>> /cgi-bin/WebObjects/Application.woa.
>>>>>> 
>>>>>> Any ideas?
>>>>>> 
>>>>>> Farrukh
>>>>>> _______________________________________________
>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>> Webobjects-dev mailing list      ([email protected])
>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>> http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%40mac.com
>>>>>> 
>>>>>> This email sent to [email protected]
>>>>> 
>>>> 
>>> 
>> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/farrukh.ijaz%40fuegodigitalmedia.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to