Good point, Fred. I've added the following snippet to the end of the section:
"Of course, it is always a good idea to program defensively if using transport-specific entities like the HttpServletRequest and HttpServletResponse. If the transport were changed (for instance to the JMS transport), then these values would likely be null." -Chris -----Original Message----- From: Fred Dushin [mailto:[EMAIL PROTECTED] Sent: Monday, April 16, 2007 12:11 PM To: [email protected] Subject: Re: Accessing Message Context, HttpServletRequest, and HttpServletResponse Just bear in mind that this is fragile, and servants should be coded defensively for the case in which this information is not available. (E.g., due to underlying changes in the transport implementation, or an administrative modification that changes the transport type, all together) That being said, the idea that all information about the request context is available is laudable, and CXF should be commended for it. You never know when an application is going to need information about what's really going on under the hood, and in a managed language like Java, it's pretty senseless to throw this information away. -Fred On Apr 16, 2007, at 11:52 AM, Christopher Moesel wrote: > I needed access to the request object from within my service > implementation. So after finding nothing in the documentation, I dug > through the samples and found a way. > > I thought this would be useful to others, so I added it to the User > Guide WIKI at the bottom of: > http://cwiki.apache.org/confluence/display/CXF20DOC/Servlet+Transport > > If this is the incorrect place for it, or if this is not the > recommended > approach, please feel free to modify, move, or delete it at will. > > Thanks, > Chris >
