Announcement Announcement Module
Collapse
No announcement yet.
Why my interceptor doesn't work for this form controller? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why my interceptor doesn't work for this form controller?

    I have a form controller which is like the SimpleFormController in the pre-2.5 version as the following:
    Code:
    public class InvitationController extends AbstractMailingController {
    // ...
    	@RequestMapping(value = "/group/invite.htm", method = RequestMethod.GET)
    	public String setupForm(HttpServletRequest request, Model model)
    			throws Exception {
    // ...
    		return "group.invitation";
    	}
    
    	@RequestMapping(value = "/group/invite.htm", method = RequestMethod.POST)
    	public String processSubmit(
    			@ModelAttribute("invitationForm") MailingForm mailingForm,
    			HttpServletRequest request, BindingResult result,
    			SessionStatus status) throws Exception {
    // ...
    		return "redirect:/group/view.htm";
    	}
    }
    And it is configured in the myServlet.xml file as:
    Code:
    	<bean id="groupInvitationController"
    		class="com.xyz.abc.web.group.InvitationController"
    		p:mailSender-ref="mailSender"/>
    //...
    	<bean id="secureHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="interceptors">
    			<list>
    				<ref bean="signonInterceptor"/>
    			</list>
    		</property>
    		<property name="urlMap">
    			<map>
    // ...
    				<entry key="/group/invite.htm"><ref local="groupInvitationController"/></entry>				
    			</map>
    		</property>
    	</bean>
    The interceptor doesn't catch the URL "/group/invite.htm" while it works for URLs in a MultiactionController like controller.

    What I am missing here?
Working...
X