You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Lieven De Keyzer <li...@hotmail.com> on 2005/05/26 19:24:23 UTC

JPetStore - BaseBean / BeanAction

I'm building my webapplication with struts, using the BaseBean.java concept 
of JPetStore.
In a class that extends the BaseBean class, I can access application, 
request, session etc. variables by doing:

Map applicationMap = ActionContext.getActionContext().getApplicationMap();
Timer tasks = (Timer) applicationMap.get("tasks");

Under the surface, the ApplicationMap makes getAttributes calls to the 
ServletContext. But now I want to use the getResourceAsInputStream method of 
ServletContext. Should I add a method to ApplicationMap? If I do this, it 
isn't really a 'Map' anymore, is it?



RE: JPetStore - BaseBean / BeanAction

Posted by Lieven De Keyzer <li...@hotmail.com>.
Allright, I found it.

ActionContext().getRequest().getSession().getServletContext()

I looked over the getRequest() method.

>From: "Lieven De Keyzer" <li...@hotmail.com>
>Reply-To: ibatis-user-java@incubator.apache.org
>To: ibatis-user-java@incubator.apache.org
>Subject: JPetStore - BaseBean / BeanAction
>Date: Thu, 26 May 2005 17:24:23 +0000
>
>I'm building my webapplication with struts, using the BaseBean.java concept 
>of JPetStore.
>In a class that extends the BaseBean class, I can access application, 
>request, session etc. variables by doing:
>
>Map applicationMap = ActionContext.getActionContext().getApplicationMap();
>Timer tasks = (Timer) applicationMap.get("tasks");
>
>Under the surface, the ApplicationMap makes getAttributes calls to the 
>ServletContext. But now I want to use the getResourceAsInputStream method 
>of ServletContext. Should I add a method to ApplicationMap? If I do this, 
>it isn't really a 'Map' anymore, is it?
>
>