一步一步学Spring.NET——1、Spring.NET环境准备
Spring.NET 1.3.2下载地址:http://down.51cto.com/data/861700
下载后解压
Spring.NET-1.3.2.7z:这个里面有我们须要用到的全部东西。
Spring.NET-1.3.2.exe:安装文件
Spring.NET-1.3.2-API.chm:帮助文档
NHibernate 3.2 的下载地址:
http://sourceforge.net/projects/nhibernate/files/NHibernate/3.2.0GA/
点击上面红框就能够进行下载了。
1、我们先点击安装文件Spring.NET-1.3.2.exe进行安装。安装过程点击下一步就能够了。
完毕后,你会看到例如以下界面:
2、打开Spring.NET的安装文件夹,能够看到例如以下界面:
3、展开Spring.Net安装文件夹,
主要目录说明:
lib:经常使用的程序集,当中包括了 NHibernate 3.2 的程序集
schema:Xml 的架构文件 ,提供XML的智能感知功能。操作说明:将 schema 中的 .xsd文件 拷贝到 Visual Studio 的安装文件夹下的 Xml\Schemas 文件夹中就能够实现xml智能提示了
配置Spring.Net站点
1、新建一个web站点,加入一个Index.aspx页面。
2、加入程序集 Spring.Core.dll 和 Spring.Web.dl。Common.Logging.dll的引用
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvem91eXVqaWUxMTI3/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
为了方便管理,新建一个BLL文件夹,然后从Spring.Net的安装文件夹拷贝这三个dll程序集过来,然后加入对这三个程序集的引用。
我用的是VS2010,所以拷贝4.0文件夹以下的dll文件。
Spring.NET\Spring.NET\Spring.NET-1.3.2\Spring.NET\bin\net\4.0\release文件夹以下
3、配置web.config
在站点的 web.config 配置文件里,进行例如以下配置
<configuration>
<configSections>
<!-- Spring 的配置 -->
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
</sectionGroup>
</configSections>
<spring>
<context>
</context>
</spring>
<system.web>
<compilation debug="false" targetFramework="4.0" />
<httpModules>
<!--Spring 提供的 Module-->
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
</httpModules>
<httpHandlers>
<!--Spring 提供的处理程序-->
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
<!--取消 Spring.NET 对于 Web 服务的处理-->
<add verb="*" path="*.asmx" type="Spring.Web.Services.WebServiceHandlerFactory, Spring.Web"/>
<add verb="*" path="ContextMonitor.ashx" type="Spring.Web.Support.ContextMonitor, Spring.Web"/>
<add verb="*" path="*.ashx" type="Spring.Web.Support.DefaultHandlerFactory, Spring.Web"/>
</httpHandlers>
</system.web>
</configuration>
如今。页面应该能够正常浏览了。从此以后的页面将通过 Spring.NET 创建与管理。
最新文章
- Data URI 应用场景小结
- PHP函数-检查某个值是否存在于数组中
- 中国版 Azure 现提供 Azure Traffic Manager
- qt环境问题导致的编译错误
- Codeforces Round #194 (Div. 2) D. Chips
- jdbc详解(三)
- PostgreSQL数据的导出导入 save your data!
- oracle监听(lsnrctl)详解解读
- windows平台python 2.7环境编译安装zbar
- weui 中的tabbar导航
- CentOS7使用yum安装配置Redis
- FTP出现PORT模式成功, 请更新你的站点配置文件
- vmware 中配置centos 7 静态IP
- TCP的三次握手 与 四次挥手
- IE缓存查看的方法
- SublimeText SFTP连接Amazon EC2
- [转]Hive开发总结
- 让VCL的皮肤用在手机程序里 让安桌程序不山寨[转]
- 使用webpack和react搭建项目
- some ideas
热门文章
- Eclipse generate javadoc
- Linux命令之chattr
- If you want to allow applications containing errors to be published on the server
- Standard - 多线程基本概念面试题待整理
- 【数形结合】Erratic Expansion
- BZOJ 4810 [Ynoi2017]由乃的玉米田(莫队+bitset)
- BZOJ 4403 序列统计(Lucas)
- 【带权并查集】Gym - 100923H - Por Costel and the Match
- Android Studio自动化快速实现Parcelable接口序列化
- Problem H: 零起点学算法87——打印所有低于平均分的分数