Re: implementing HTTPServlet with WebObjects
Re: implementing HTTPServlet with WebObjects
- Subject: Re: implementing HTTPServlet with WebObjects
- From: John Huss <email@hidden>
- Date: Tue, 27 May 2014 11:14:58 -0500
You can get the
WOServletContext and the WOServletRequest from the userInfo in the WORequest using these keys:
aRequest.userInfo().get("HttpServletRequest")
aRequest.userInfo().get("HttpServletResponse")
aRequest.userInfo().get("ServletConfig")
aRequest.userInfo().get("ServletContext")
While using strings in this way is somewhat questionable, at least you don't have to worry about a future release of WO changing it.
If you just need the ServletContext you would be better off subclassing ERXServletAdaptor and overriding init(). But if you do that you'll have to change the web.xml file during the build process to reference your subclass. In the "ssdd" target add a line to do a string replace:
<replace file="${dest.dir}/${build.app.name}/WEB-INF/web.xml" token="OLD" value="NEW" />
_______________________________________________
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