We've got a large system that's loosely bound to its data source (Navision) via Unity - we're getting the opportunity to swap it out and have our own database. So we've had a look around and really like the look of Fluent NHibernate - we're trying to…
今天,项目突然报"java.lang.NumberFormatException:For input string:"id"",项目框架是spring,springmvc,hibernate,大致意思是类型转换错误,我的id是Integer类型,报错在<c:foreach>里的option里获取值得时候出问题,说明数据类型不对,就去后台dao去找,查看我的sql,一看我查的是表的部分字段,用的hibernate框架,返回的一个List<object…
MSDN上解释Page.FindControl(string id)方法用于查找指定ID的控件.例如: <asp:TextBox id="Email" runat="server"></asp:TextBox> TextBox txt = this.Page.FindControl("Email") as TextBox; txt.Text = "abc@163.com"; 该方法有点类似javascr…
我们知道在spring中每个bean都要有一个id或者name标示每个唯一的bean,在xml中定义一个bean可以指定其id和name值,但那些没有指定的,或者注解的spring的beanname怎么来的的?就是BeanNameGenerator接口实现的特性. <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <pro…
默认情况下,<context:component-scan>查找使用构造型(stereotype)注解所标注的类,如@Component(组件),@Service(服务),@Controller(控制器),@Repository(数据仓库) 我们具体看下<context:component-scan>的一些属性,以下是一个比较具体的<context:component-scan>配置 <context:component-scan base-package=&qu…
前言 Spring配置文件读取流程本来是和http://www.cnblogs.com/xrq730/p/6285358.html一文放在一起的,这两天在看Spring自定义标签的时候,感觉对Spring配置文件读取流程还是研究得不够,因此将Spring配置文件读取流程部分从之前的文章拆出来单独成为一文. 为了看一下Spring配置文件加载流程,先定义一个bean.xml: <?xml version="1.0" encoding="UTF-8"?> &…
很多朋友可能想看Spring源码,但是不知道应当如何入手去看,这个可以理解:Java开发者通常从事的都是Java Web的工作,对于程序员来说,一个Web项目用到Spring,只是配置一下配置文件而已,Spring的加载过程相对是不太透明的,不太好去找加载的代码入口. 下面有很简单的一段代码可以作为Spring代码加载的入口: 1 2 ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml"); ac…
<context:component-scan>详解   默认情况下,<context:component-scan>查找使用构造型(stereotype)注解所标注的类,如@Component(组件),@Service(服务),@Controller(控制器),@Repository(数据仓库) 我们具体看下<context:component-scan>的一些属性,以下是一个比较具体的<context:component-scan>配置 <cont…
1.web.xml文件配置 <!-- spring mvc --> <servlet> <servlet-name>DispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextCon…
Spring源码入门——DefaultBeanNameGenerator解析   我们知道在spring中每个bean都要有一个id或者name标示每个唯一的bean,在xml中定义一个bean可以指定其id和name值,但那些没有指定的,或者注解的spring的beanname怎么来的的?就是BeanNameGenerator接口实现的特性. <bean id="transactionManager" class="org.springframework.orm.jp…