(一),到struts官方网站下载struts-2.0.11.1-all.zip.URL:http://struts.apache.org/download.cgi#struts20111
(二),打开intelliJ IDEA新建空的Web Application
右键工程加入struts2的jar包:
commons-logging-1.0.4.jar,
freemarker-2.3.8.jar,
ognl-2.6.11.jar,
struts2-core-2.0.11.1.jar,
xwork-2.0.4.jar
(三),一切就绪,开始编码
首先配置web.xml,代码如下:
&l ...
(1)利用java.util.Properties读取属性文件
properties属性文件config.properties:
business.class=spring.Business
writer.class=spring.FloppyWriter
InputStream is = this.getClass().getClassLoader().getResourceAsStream("config.properties");
Properties pro = new Properties();
pro.load(is);
String busines ...







评论排行榜