spring 中加载xml配置文件的方式
spring 中加载xml配置文件的方式 spring 中加载xml配置文件的方式,好像有3种, xml是最常见的spring 应用系统配置源。Spring中的几种容器都支持使用xml装配bean,包括: XmlBeanFactory , ClassPathXmlApplicationContext , FileSystemXmlApplicationContext , XmlWebApplicationContext 一:XmlBeanFactory 引用资源 Resource resource = new ClassPathResource("appcontext.xml"); BeanFactory factory = new XmlBeanFactory(resource); 二:ClassPathXmlApplicationContext 编译路径
myeclipse 中的'ISO-8859-1'编码问题
myeclipse 中的'ISO-8859-1'编码问题: 在eclipse中创建tomcat project工程后,在创建的jsp文件中若包含中文,当保存文件时,会弹出提示框,并使保存失败。提示框的内容为:''Some characters cannot be mapped using 'ISO-8859-1' character encoding. Either changethe encoding or remove the characters which are not supported by the 'ISO-8859-1' character encoding." ,在网上查了一下解决办法,找到3条:1:在文件开头增加<%@page pageEncoding="GBK"%>2:应该使用eclipse的jinto插件编辑,会自动调用java的
静态类不能被继承(其继承类不能被实例化,等于不能继承)
开始听同事在那讨论,有人问静态类是否能被继承,我觉得是不能,但没有找到有说服力的例子,于是写了一段简单的代码来测试,如下:public class staticTest {static class aa{ void abc(){System.out.println("1111111");}}class bb extends aa{void abc(){System.out.println("222222");}}public static void main(String[] args) {//bb x = new bb();aa y = new aa();y.abc(); }}其中aa为静态类,bb为其继承类,类aa能像aa y = new aa();实例化,但类bb却会出错,eclipse中提示为No enclosing instance of type sta