Is there a way to validate request attributes passed from Servlet to JSP?

For example, in my Servlet I do something like this:

```
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Foo foo = new Foo();
    request.setAttribute("foo", foo);
    RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/bar.jsp);
    dispatcher.forward(request, response);
}

```

bar.jsp looks like this:

```
<html>
    <body>
        ${foo.getBaz}
    </body>
</html>

```

In bar.jsp, is there a way to ensure that the "foo" attribute is a Foo object? We use the Maven JSPC plugin to compile JSPs and it'd be nice to catch refactoring/renaming errors (like Foo.getBaz() being renamed to Foo.getFluff()) at compile-time.