vr.setExposeContextBeansAsAttributes(true);
vr.setApplicationContext(wac);
MockHttpServletRequest request = new MockHttpServletRequest(sc) {
public RequestDispatcher getRequestDispatcher(String path) {
return new MockRequestDispatcher(path) {
public void forward(ServletRequest forwardRequest, ServletResponse forwardResponse) {
assertTrue("Correct rc attribute", forwardRequest.getAttribute("rc") == null);
assertEquals("value1", forwardRequest.getAttribute("key1"));
assertEquals(new Integer(2), forwardRequest.getAttribute("key2"));
assertSame(wac.getBean("myBean"), forwardRequest.getAttribute("myBean"));