cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <g...@tuffmail.com>
Subject Re: Getting the request object in a class implementing Listener interface cocoon 2.2
Date Fri, 06 Jun 2008 17:15:01 GMT
Imran Pariyani pisze:
> Hi all,
> 
> for the old cocoon i.e 2.1.x we use to access the request object inside 
> the ActionListener implementation class with the following code ..
> 
> final Request request = 
> ObjectModelHelper.getRequest(CocoonComponentManager.getCurrentEnvironment()
>                    .getObjectModel());
> 
> for cocoon 2.2 can i use the following code to access the request object
> 
> ProcessInfoProvider processInfoProvider = (ProcessInfoProvider) 
> WebAppContextUtils
>                    
> .getCurrentWebApplicationContext().getBean(ProcessInfoProvider.ROLE);
>            final Map objectModel = processInfoProvider.getObjectModel();
>            final Request request = 
> ObjectModelHelper.getRequest(objectModel);
> 
> or there is some other way to get the instance of the request object ?

The better approach is to avoid using ObjectModelHepler and access Request bean directly:

WebAppContextUtils.getCurrentWebApplicationContext().getBean(javax.servlet.http.HttpServletRequest.getClass().getName());

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message