Merge pull request #11 from chriseldredge/mvc-bugfix

Fixes SPRNET-1482
This commit is contained in:
Steve Bohlen
2011-12-19 08:59:43 -08:00
2 changed files with 5 additions and 3 deletions

View File

@@ -119,12 +119,13 @@ namespace Spring.Web.Mvc
controller = (IController)controllers.Cast<DictionaryEntry>().First().Value;
}
}
else
if (controller == null)
{
//pass to base class for remainder of handling if can't find it in the context
controller = base.GetControllerInstance(requestContext, controllerType);
}
AddActionInvokerTo(controller);
return controller;

View File

@@ -85,7 +85,8 @@ namespace Spring.Web.Mvc.Tests
[Test]
public void CanRetrieveControllersNotRegisteredWithContainer()
{
_factory.CreateController(new RequestContext(new MockContext(), new RouteData()), "NotInContainer");
IController controller = _factory.CreateController(new RequestContext(new MockContext(), new RouteData()), "NotInContainer");
Assert.IsInstanceOf(typeof(NotInContainerController), controller);
}
[Test]