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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to