zoukankan      html  css  js  c++  java
  • Spring.net 在aps.net Web的配置复习

    1.引入程序集Spring.Core,CommonLogging,Spring.Web

    2.Web.Config的配置

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <sectionGroup name="spring">
          <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
          <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
        </sectionGroup>
        
      </configSections>
      <spring>
        <context>
          <resource uri="config://spring/objects"/>
          <resource uri="~/Config/BLL.xml"/>
        </context>
        <objects xmlns="http://www.springframework.net">
          <object id="student" type="WebApplication5.Student, WebApplication5">
          </object>
        </objects>
      </spring>
        <system.web>
          <compilation debug="true" targetFramework="4.5" />
          <httpRuntime targetFramework="4.5" />
          <httpHandlers>
            
          </httpHandlers>
        </system.web>
      <system.webServer>
        <modules>
          <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
        </modules>
        <handlers>
          <add name="handle1" verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
        </handlers>
        <directoryBrowse enabled="true"/>
        
      </system.webServer>
    </configuration>

    BLL.XML

    <?xml version="1.0" encoding="utf-8" ?>
    <objects xmlns="http://www.springframework.net">
    <object id="Teacher" type="WebApplication5.Teacher,WebApplication5">
    </object>
    </objects>


    3. 客户端调用部分

    IApplicationContext ctx = ContextRegistry.GetContext();
                Student  stu=ctx["Student"] as Student;
                stu.SayHello();

  • 相关阅读:
    WCF 通讯标准绑定
    FTP FtpWebRequest 异步上传文件
    适用于zTree 、EasyUI tree、EasyUI treegrid
    PropertyInfo 类
    通过类库ChineseChar实现将汉字转化为拼音
    使用内存流导出Excel
    钉钉开发文档示例
    .Net Mail SMTP 发送网络邮件
    C# 解析 Json数据
    Newtonsoft.Json高级用法(转)
  • 原文地址:https://www.cnblogs.com/kexb/p/4573866.html
Copyright © 2011-2022 走看看