示例#1
0
    public IController CreateController(RequestContext context, string controllerName)
    {
        IController controller          = null;
        string      controllerClassName = string.Format("{0}Controller", controllerName);

        if (SpringApplicationContext.Contains(controllerClassName))
        {
            controller          = SpringApplicationContext.Resolve <IController>(controllerClassName);
            this.RequestContext = context;
        }
        else
        {
            controller = base.CreateController(context, controllerName);
        }
        return(controller);
    }
示例#2
0
 /// <summary>
 /// Return a instance of an object in the context by the specified name and type.
 /// </summary>
 /// <typeparam name="T">Accepts the type of the object to resolve.</typeparam>
 /// <param name="objectName">Accepts a string object name.</param>
 public static T Resolve <T>(string objectName)
 {
     return((T)SpringApplicationContext.Resolve(objectName));
 }