Re: Accessing ASO 'Visit' from servlet filter

2006-07-10 Thread hv @ Fashion Content
I haven't tried accessing ASO's, but I have a threaded HiveMind service which I use on my tapestry pages. This is the code I use in my ServletFilter if (firstRegistry == null) { firstRegistry = (Registry) context.getAttribute(org.apache.tapestry.Registry:portalapp); } if

Re: Accessing ASO 'Visit' from servlet filter

2006-07-08 Thread Shing Hing Man
I think I have found a solution. Recall that you have a NPE about 'webRequest' being null in the serivce tapestry.globals.RequestGlobals. Usually, the webRequest (and webResponse) in requestGlobal is set in WebRequestServicerPipelineBridge.java. Here is the route to

Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Finster Hannon
I would like to get access to my ASO 'Visit' from a servlet filter let's say. I have used a piece I saw Howard post where I am subclassing the ApplicationServlet which will provide access to the HiveMind (HM) registry. I would think then calling from anywhere in the app to the servlet would

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Shing Hing Man
I have noticed that in the retrieveVisit method of InjectStateWorker.java : visit = (Visit) _applicationStateManager.get(visit) ; But in the hivemodule.xml, the state object name is 'Visit' with a captial V. You might like to rename 'visit' to something else. I do not know whether it would

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Shing Hing Man
Sorry ! Here is the correct link. http://lombok.demon.co.uk/tapestry4Demo/app Shing --- Shing Hing Man [EMAIL PROTECTED] wrote: I have noticed that in the retrieveVisit method of InjectStateWorker.java : visit = (Visit) _applicationStateManager.get(visit) ; But in the

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Joseph Hannon
Shing, I did change the 'Visit' id to something else, 'message', as a test and still get the exception of webRequest being null. From your website: HelloMessage message = (HelloMessage) getAppStateManager().get(message); How are you calling getAppStateManager(), from what class? How are you

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Joseph Hannon
Shing, Cool. I did replace set-object with the set-service and got the same exception. If you will notice in my original post, this was commented out, I uncommented it and commented the line with set-object . Would you mind showing some code where you are getting your asoService class

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Shing Hing Man
Here is the java class for the asoSevice mentioned in my how-to. Shing ASOService.java : public class ASOService implements IEngineService { @SuppressWarnings(unused) private static Logger log = Logger.getLogger(ASOService.class); public static final String

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Shing Hing Man
The registry is stored in the servlet context. You can retreived it by : String REGISTRY_KEY_PREFIX = org.apache.tapestry.Registry:; ServletContext context = getServletContext(); Registry registry = (Registry) context.getAttribute(REGISTRY_KEY_PREFIX + testPojoASO);

Re: Accessing ASO 'Visit' from servlet filter

2006-07-07 Thread Shing Hing Man
I have run out of idea. If I come up with something useful, I'll inform you. Shing --- Joseph Hannon [EMAIL PROTECTED] wrote: Follow up: I can get the Visit object from my filter's ServletRequest session.getAttribute(state:apply:Visit), but I was attempting to really use a proper