|
From: Claudio D'A. <cla...@ob...> - 2004-03-18 15:43:41
|
It's perfect Thanks At 16.22 18/03/2004 +0100, you wrote: >The problem is that DispatcherServlet doesn't know the bean name of the >handlers that a HandlerMapping returns: The handlers don't even have to >have names in the first place. > >What you could do is let your Finder class implement BeanNameAware and >store the passed-in bean name there. In your HandlerInterceptor, check for >Finder and fetch the bean name from it. Alternatively, you could also >check the request URI directly. > >Juergen > > >________________________________ > >Von: spr...@li... im Auftrag von >Kopylenko, Dmitry >Gesendet: Do 18.03.2004 16:14 >An: 'spr...@li...' >Betreff: RE: [Springframework-developer] Handler Interceptor > > >I wouldn't mess around with changing the API at this point because this >API is used in production deployments > >Dmitriy. > > -----Original Message----- > From: Claudio D'Angelo [mailto:cla...@ob...] > Sent: Thursday, March 18, 2004 10:08 AM > To: spr...@li... > Subject: [Springframework-developer] Handler Interceptor > > > Hi, > I need of an Interceptor that controls the execution of workflow: > The methods of the HandleInterceptor are: > public boolean preHandle(javax.servlet.http.HttpServletRequest > request, javax.servlet.http.HttpServletResponse response, > java.lang.Object handler) > public void postHandle(javax.servlet.http.HttpServletRequest > request, javax.servlet.http.HttpServletResponse response, > java.lang.Object handler, ModelAndView modelAndView) > public void afterCompletion(javax.servlet.http.HttpServletRequest > request, javax.servlet.http.HttpServletResponse response, > java.lang.Object handler, java.lang.Exception ex) > > > In all method is passed the instance of Controller that must be > execute but I need to know about the bean name (id value of configuration > file) becouse I've have similar bean with different id: > ie: > > <bean name="/find.do" class="it.test.view.Finder"> > ... > <property name="commandName"> > <value>command</value></property> > <property > name="formView"><value>.find.normal</value></property> > <property > name="successView"><value>.detail.Normal</value></property> > </bean> > <bean name="/extendedFind.do" class="it.test.view.Finder"> > ... > <property name="commandName"> > <value>command</value></property> > <property > name="formView"><value>.find.extended</value></property> > <property > name="successView"><value>.detail.extended</value></property> > </bean> > > All becouse the Command is the same but the view is different. > > Is possible change the interface ? in : > public boolean preHandle(javax.servlet.http.HttpServletRequest > request, javax.servlet.http.HttpServletResponse response, > java.lang.Object handler, String beanName) > public void postHandle(javax.servlet.http.HttpServletRequest > request, javax.servlet.http.HttpServletResponse response, > java.lang.Object handler, String beanName, ModelAndView modelAndView) > public void afterCompletion(javax.servlet.http.HttpServletRequest > request, javax.servlet.http.HttpServletResponse response, > java.lang.Object handler, String beanName, java.lang.Exception ex) > > > > > > Grazie e buon lavoro > >________________________________ > > Claudio D'Angelo > Software Consultant > ObjectWay S.p.A. > Via G.A. Boltraffio 7 > 20159 Milano (MI) > http://www.objectway.it <http://www.objectway.it/> > > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration. >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer Grazie e buon lavoro ---------- Claudio D'Angelo Software Consultant ObjectWay S.p.A. Via G.A. Boltraffio 7 20159 Milano (MI) http://www.objectway.it |