Bean实例化的三种方式 说明:通过配置文件创建对象就称为Bean实例化. 第一种:使用类的无参构造创建(重点) 实体类 package com.tyzr.ioc; public class User { private String username; public User(String username) { super(); this.username = username; } public User() { } public void add(){ System.out.printl…
1. 在web容器中设置(此处以tomcat为例) 在tomcat-6.0\conf\web.xml中设置,以下是tomcat 6.0中的默认配置: <!-- ==================== Default Session Configuration ================= --> <!-- You can set the default session timeout (in minutes) for all newly --> <!-- create…
1. 在web容器中设置(此处以tomcat为例) 在tomcat-5.0.28\conf\web.xml中设置,以下是tomcat 5.0中的默认配置: <!-- ==================== Default Session Configuration ================= --> <!-- You can set the default session timeout (in minutes) for all newly --> <…
android中解析文件的三种方式 好久没有动手写点东西了,最近在研究android的相关技术,现在就android中解析文件的三种方式做以下总结.其主要有:SAX(Simple API for XML),DOM(Document Object Model),Pull.其中前面两种和JAVA中解析XML文件方法类似,第三种解析方式则是Android自带集成的解析方式. SAX解析:属于事件驱动解析,先不解析整个文档,如果解析到符合XML要求的,我们则可以返回.这样解析的优势是我们…