In the server side, i need to know who is performing this action to do auditing and other related services. So I need to use a thread local variable that will be available at any place in the chain of request until response is sent back. But I do not know how to set this thread local variable at the time of request. I have the current user in session, so i need to get it from session and set it to thread local variable on each request. if possible distinguish and filter only user request actions instead for all css, js request.
When i look at the stack trace, when i click a submit link to update employee.. this is the strucutre. I am interested to intercept between this to set the thread local variable. how do i do it ? ForceDAO.updateDO(T) line: 153 EmployeeService.updateEmployee(Employee) line: 43 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 LazyInitProxyFactory$JdkHandler.invoke(Object, Method, Object[]) line: 416 $Proxy38.updateEmployee(Employee) line: not available EmpAddForm$1.onSubmit(AjaxRequestTarget, Form<?>) line: 152 Stack Trace ------------- Thread [btpool0-5] (Suspended (breakpoint at line 43 in CrudInterceptor)) CrudInterceptor.onFlushDirty(Object, Serializable, Object[], Object[], String[], Type[]) line: 43 DefaultFlushEntityEventListener.invokeInterceptor(SessionImplementor, Object, EntityEntry, Object[], EntityPersister) line: 372 DefaultFlushEntityEventListener.handleInterception(FlushEntityEvent) line: 349 DefaultFlushEntityEventListener.scheduleUpdate(FlushEntityEvent) line: 287 DefaultFlushEntityEventListener.onFlushEntity(FlushEntityEvent) line: 155 DefaultFlushEventListener(AbstractFlushingEventListener).flushEntities(FlushEvent) line: 219 DefaultFlushEventListener(AbstractFlushingEventListener).flushEverythingToExecutions(FlushEvent) line: 99 DefaultFlushEventListener.onFlush(FlushEvent) line: 50 SessionImpl.flush() line: 1216 HibernateTemplate(HibernateAccessor).flushIfNecessary(Session, boolean) line: 390 HibernateTemplate.doExecute(HibernateCallback<T>, boolean, boolean) line: 407 HibernateTemplate.executeWithNativeSession(HibernateCallback<T>) line: 374 HibernateTemplate.update(Object, LockMode) line: 705 HibernateTemplate.update(Object) line: 701 ForceDAO.updateDO(T) line: 153 EmployeeService.updateEmployee(Employee) line: 43 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 LazyInitProxyFactory$JdkHandler.invoke(Object, Method, Object[]) line: 416 $Proxy38.updateEmployee(Employee) line: not available EmpAddForm$1.onSubmit(AjaxRequestTarget, Form<?>) line: 152 AjaxSubmitLink$1.onSubmit(AjaxRequestTarget) line: 68 AjaxSubmitLink$1(AjaxFormSubmitBehavior).onEvent(AjaxRequestTarget) line: 143 AjaxSubmitLink$1(AjaxEventBehavior).respond(AjaxRequestTarget) line: 177 AjaxSubmitLink$1(AbstractDefaultAjaxBehavior).onRequest() line: 300 BehaviorRequestTarget.processEvents(RequestCycle) line: 119 ForceWebApplication$2(AbstractRequestCycleProcessor).processEvents(RequestCycle) line: 92 ForceWebRequestCycle(RequestCycle).processEventsAndRespond() line: 1250 ForceWebRequestCycle(RequestCycle).step() line: 1329 ForceWebRequestCycle(RequestCycle).steps() line: 1436 ForceWebRequestCycle(RequestCycle).request() line: 545 ForceWicketFilter(WicketFilter).doGet(HttpServletRequest, HttpServletResponse) line: 484 ForceWicketFilter.doGet(HttpServletRequest, HttpServletResponse) line: 27 ForceWicketFilter(WicketFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 317 ForceWicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 21 ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse) line: 1084 ServletHandler.handle(String, HttpServletRequest, HttpServletResponse, int) line: 360 SecurityHandler.handle(String, HttpServletRequest, HttpServletResponse, int) line: 216 SessionHandler.handle(String, HttpServletRequest, HttpServletResponse, int) line: 181 WebAppContext(ContextHandler).handle(String, HttpServletRequest, HttpServletResponse, int) line: 726 WebAppContext.handle(String, HttpServletRequest, HttpServletResponse, int) line: 405 Server(HandlerWrapper).handle(String, HttpServletRequest, HttpServletResponse, int) line: 139 Server.handle(HttpConnection) line: 324 HttpConnection.handleRequest() line: 505 HttpConnection$RequestHandler.content(Buffer) line: 842 HttpParser.parseNext() line: 648 HttpParser.parseAvailable() line: 211 HttpConnection.handle() line: 380 SocketConnector$Connection.run() line: 228 BoundedThreadPool$PoolThread.run() line: 450 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/intercept-client-request-tp4113922p4113922.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org