当使用type=“redirectAction” 或type=“redirect”提交到一个action并且需要传递一个参数时。这里是有区别的: 使用type=“redirectAction”时,结果就只能写Action的配置名,不能带有后缀:“.action” <action name="Login" class="steven.actions.LoginAction"> <result name="success" type="redirectAction">User?u_id=${loginBean.u_id}</result> </act ...
(一),到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 ...