Re: _rewriteURL is not called in Tomcat Deployment
Re: _rewriteURL is not called in Tomcat Deployment
- Subject: Re: _rewriteURL is not called in Tomcat Deployment
- From: Helmut Schottmüller <email@hidden>
- Date: Wed, 15 Oct 2008 14:01:35 +0200
Hi Lachlan,
great and thanks a lot!
Regards,
Helmut
Am 15.10.2008 um 13:46 schrieb Lachlan Deck:
(this is a Wonder question)
On 15/10/2008, at 9:10 PM, Helmut Schottmüller wrote:
I am trying to rewrite my ERXApplication URL's in my Tomcat
deployment with mod_rewrite and I want to overwrite the _rewriteURL
method in my ERXApplication baseclass. When I test my application
on my local machine with directconnect everything works fine and
_rewriteURL is being called anytime an URL is generated. But in the
deployment system on tomcat it seems that _rewriteURL is not
called. I placed debug statements at the beginning of the method
but nothing happens when I create some actions in the application.
Is there something I have to set that _rewriteURL is called in the
deployment too?
This difference is that in development the WOContext subclass is
ERXWOContext (or ERXWOContext54 if using WO5.4.x). However in
deployment you're getting ERXWOServletContext which doesn't
implement the necessary call to app._rewriteURL because it's a
subclass of WOServletContext.
I've attached a patch for ERXWOServletContext (Mike, if you'd like
to apply this... it's a project relative patch).
In the meantime you can subclass ERXWOServletContext and implement
the following...
/**
*@see
com
.webobjects
.appserver
.WOContext
#_urlWithRequestHandlerKey
(java.lang.String,java.lang.String,java.lang.String,boolean,int)
*/
@Override
public String _urlWithRequestHandlerKey(String requestHandlerKey,
String requestHandlerPath, String queryString, boolean isSecure, int
somePort) {
String url = super._urlWithRequestHandlerKey(requestHandlerKey,
requestHandlerPath, queryString, isSecure, somePort);
url = ERXApplication.erxApplication()._rewriteURL(url);
return url;
}
Then in your Application class
public void finishInitilization()
{
super.finishInitialization();
ERXPatcher.setClassForName(YourServletContext.class,
"com.webobjects.jspservlet.WOServletContext");
}
with regards,
--
Lachlan Deck
<ERXWOServletContext.java.patch>
_______________________________________________
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