Announcement Announcement Module
Collapse
No announcement yet.
Can't intercept some controllers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't intercept some controllers

    I have added an aspect on controllers in my web layer. For 90% of the controllers this aspect is working fine, but a few that have an inheritance hierarchy, it is not working. The problem is that the @RequestMapping annotation is not being picked up and I get a HTTP Status 404 on /myapp/WEB-INF/jsp/mypage.jsp. Any idea why this would be happening? The relevant code is shown below:

    Code:
    public interface StatementController {
    
        ModelAndView renderStatement(
            final HttpServletResponse response,
            final HttpServletRequest request) throws Exception;
    }
    Code:
    public abstract class BaseStatementController implements StatementController {
    
        protected ModelAndView renderStatementHelper(
                final HttpServletResponse response,
                final HttpServletRequest request) throws Exception {
                ...
        }
    }
    Code:
    @Controller
    public class PeriodicStatementController extends BaseStatementController {
    
        @RequestMapping( { "/mypage.html", "/mypage2.html" })
        public ModelAndView renderStatement(
                final HttpServletResponse response,
                final HttpServletRequest request) throws Exception {
            return this.renderStatementHelper(response, request);
        }
    }
    Note the request mapping above that works when I don't have the interceptor, but as soon as I put the interceptor, I get HTTP status 404.

    My pointcut expression is shown below:

    Code:
    @Pointcut("execution(* myapp..*Controller.*(..))")
    public void frontEnd() {
    }
    Thanks.
    Naresh
Working...
X