This is a bug in the MessageContext which has been discussed recently on
 the dev list. The getProperties() method of the MessageContext always
returns an empty map. So you can only get those properties you know the
key of by calling getProperty(key).

Carsten

Deepal Jayasinghe wrote:
> You need to call
> msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST);
> 
> heikki wrote:
> 
>> Hi there,
>>
>> I'm trying to retrieve the HttpServletRequest in a handler, through
>> its MessageContext, like so
>>
>> HttpServletRequest httpServletRequest = (HttpServletRequest)
>> msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST );
>>
>> However, running this,  httpServletRequest was null. On further
>> examination I looked at all the properties I could get from
>> MessageContext, using this code
>>
>>         Map propsMap = msgContext.getProperties();
>>         if(propsMap.size() == 0) {
>>             System.out.println("msgContext props map is empty !!!  ");
>>         }
>>         Set propsSet = props.entrySet();
>>         if(propsSet.size() == 0) {
>>             System.out.println("msgContext props set is empty !!!  ");
>>         }
>>
>> which put out this
>>
>> msgContext props map is empty !!!
>> msgContext props set is empty !!!
>>
>> Apparently, I don't have any property in the MessageContext in the
>> handler. Is this usual? Should I take some extra step somewhere along
>> the line?
>>
>> My purpose of getting HttpServletRequest is to retrieve URL params
>> from the HTTP GET request. Is there another way to do achieve this?
>>
>>
>> thanks and regards,
>> Heikki Doeleman
> 
> 


-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to