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: Lachlan Deck <email@hidden>
- Date: Wed, 15 Oct 2008 22:46:46 +1100
(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
Attachment:
ERXWOServletContext.java.patch
Description: Binary data
_______________________________________________
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