Spring.net页面属性注入
.条件spring.web程序集
1.1 system.web配置
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
</httpHandlers>
1.2 httpModules配置
<httpModules>
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
</httpModules>
1.3 system.webserver配置
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
</modules>
<handlers>
<add name="SpringPageHandler" verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory,
Spring.Web"/>
<add name="SpringContextMonitor" verb="*" path="ContextMonitor.ashx" type="Spring.Web.Support.ContextMonitor,
Spring.Web"/>
</handlers>
</system.webServer>
1.4 spring xml配置 注意type要写web的文件路径否则会出错,网站大多是抄的,所以都只有一个Default.aspx,这里要特别注意否则功亏一篑
<object type="~/admin/Sys/SysDictTypeEdit.aspx">
<property name="Psvc" ref="SysDictTypeService"/>
</object>
<object id="SysDictTypeService" type="Bll.SysDictTypeService, HRABLL">
<property name="Dao" ref="CommonService"/>
<property n
1.5 页面放个属性就好了
private Contract.IService.ISysDictTypeService psvc;
/// <summary>
/// 初始化
/// </summary>
public Contract.IService.ISysDictTypeService Psvc
{
get;set;
}
Spring.net页面属性注入的更多相关文章
- 这篇文章,我们来谈一谈Spring中的属性注入
本系列文章: 读源码,我们可以从第一行读起 你知道Spring是怎么解析配置类的吗? 配置类为什么要添加@Configuration注解? 谈谈Spring中的对象跟Bean,你知道Spring怎么创 ...
- Spring框架的属性注入
1. 对于类成员变量,常用的注入方式有两种 * 构造函数注入(没有空的构造方法注入) * 属性setter方法注入(有空的构造方法注入) 2. 在Spring框架中提供了前两种的属性注入的方式 1. ...
- Spring笔记②--各种属性注入
Ioc 反转控制 反转资源获取的方向 分离接口与实现 采用工厂模式 采用反转控制 Di 依赖注入 依赖容器把资源注入 配置bean 通过全类名(反射) 配置形式:基于xml方式 Ioc容器的b ...
- Spring学习笔记(二)——Spring相关配置&属性注入&Junit整合
一.Spring的相关配置 1.1 Bean元素 class属性:被管理对象的完整类名 name属性:给Bean起个名字,能重复,能使用特殊字符.后来属性 id属性:给Bean起个名字,不能重复,不能 ...
- Spring - IoC(2): 属性注入 & 构造注入
依赖注入是指程序运行过程中,如果需要另外的对象协作(访问它的属性或调用它的方法)时,无须在代码中创建被调用者,而是依赖于外部容器的注入. 属性注入(Setter Injection) 属性注入是指 I ...
- Spring为某个属性注入值或为某个方法的返回值
项目中用到需要初始化一些数据,Spring提供了filed的值注入和method的返回值注入. 一.Field值的注入 filed值注入需要使用org.springframework.beans.fa ...
- Spring入门_02_属性注入
Spring 的set方法(属性)注入 UserAction类中设置属性和get.set方法.(实际上只需要set方法) private List list = null; private Set s ...
- Spring中的属性注入注解
@Inject使用 JSR330规范实现的 默认按照类型注入 如果需要按照名称注入,@Inject需要和@Name一起使用 @Resource JSR250规范实现的,需要导入不同的包 @Resour ...
- 【Java Web开发学习】Spring构造器和属性注入
测试类 public class Construct { private String address; private long phone; public Construct(String nam ...
随机推荐
- LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突:请使用 /NODEFAULTLIB:library 转自:http://blog.csdn.net/pgms ...
- 简单的使用POI导出excel
package org.test; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java ...
- java中FIle的用法
package com.a.b; import java.io.*; public class Cmo { public static void main(String[] args) throws ...
- Zabbix 添加 WEB 监控
添加 WEB Monitorings Web Monitoring是用来监控web程序的,可以监控到web程序的下载速度.返回码及响应时间,还支持把一组连续的web动作作为一个整体来监控. 下面我们以 ...
- python学习(二十二) String(上)
str1 = "This is a 'test'" print(str1) str1 = 'This is a "test"' print(str1) str1 ...
- 【BZOJ】1823: [JSOI2010]满汉全席(2-sat)
题目 传送门:QWQ 分析 2-sat模板(然而辣鸡如我还是调了好久) 代码 //bzoj 1823 2-sat #include <bits/stdc++.h> using namesp ...
- Cocos2d-html5帧动画
单独获取plist里面一个文件: cc.SpriteFrameCache.getInstance().addSpriteFrames(s_test_plist); var spriteTest2 = ...
- 超简单让ubuntu开启wifi热点(亲测16.04与14.04可用)
今天教大家一个简单方法让ubuntu发散wifi热点给手机或者其他设备使用. 首先,创建一个普通的热点,点击右上角的网络,然后选择下拉菜单中的编辑连接,然后出现以下界面. 然后点击增加,连接类型选接W ...
- Spring Boot实践——三种拦截器的创建
引用:https://blog.csdn.net/hongxingxiaonan/article/details/48090075 Spring中的拦截器 在web开发中,拦截器是经常用到的功能.它可 ...
- ActionMQ5.8.0 JMS实例 手把手详细图解
出自:http://blog.csdn.net/tongjie008/article/details/40687087 ActionMQ 是开源的JMS实现 1.下载ActiveMQ 去官方网站下载: ...