myfaces 在程序中配置文件的操作
使用myfaces的实现类org.apache.myfaces.config.RuntimeConfig 对象可以获取当前的配置文件的信息。操作RuntimeConfig.getCurrentInstance(FactsUtils.getFacesConetxt().getExternalContext())获得这个东西后其他的操作一看就明白了。初始化中web.xml文件的解析工作是org.apache.myfaces.shared_impl.webapp.webxml.WebXmlParser完成的。在这里他将web.xml分解并完成各部分初始化操作[@more@]instanceof 运算符返回一个 Boolean 值,指出对象是否是特定类的一个实例。result = object instanceof class参数result必选项。任意变量。objec
jsf 在程序中调用受控Bean
从FacesConetext中获得一个Application对象然后使用该对象创建一个以Faces-config.xml中定义的受控Bean名ValueBinding对象,再使用该ValueBinding对象的getValue(FacesConetext)获取最终受控bean。这种方法类似Spring中的对象实例代码如下FacesConetxt().getApplication().createValueBinding(name).getValue(FacesConetxt);name="{受控bean名}"[@more@]
spring 2.0 配置文件
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/s
jdk的国际化工具 native2ascii.exe
通过该工具可以实现文版文件转换成unicode字符实现国际化。语法:native2ascii 源文件路径和名称 目标文件路径和名称[@more@]首先将JDK的bin目录加入系统变量path。在盘下建立一个test目录,在test目录里建立一个zh.txt文件,文件内容为:“熔岩”,打开“命令行提示符”,并进入C:test目录下。下面就可以按照说明一步一步来操作,注意观察其中编码的变化。 A:将zh.txt转换为Unicode编码,输出文件到u.txtnative2ascii zh.txt u.txt打开u.txt,内容为“u7194u5ca9”。 B:将zh.txt转换为Unicode编码,输出到控制台C:test>native2ascii