摘要: 1 常用方法 a、createNewFile方法 public boolean createNewFile() throws IOException 该方法的作用是创建指定的文件。该方法只能用于创建文件,不能用于创建文件夹,且文件路径中包含的文件夹必须存在。 b、delete方法 public bo 阅读全文
posted @ 2016-12-26 10:36 唯一520 阅读(787) 评论(0) 推荐(0) 编辑
摘要: StrutsApacheBeanJSPServlet attribute: 这个属性用来指定ActionForm保存到指定上下文时所使用的属性名。如果不指定attribute属性的值,将使用name属性的值作为保存时的属性名。也就是说,attribute属性的默认值就是name属性的值。 class 阅读全文
posted @ 2016-12-26 09:10 唯一520 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 众所周知,默认条件下,在浏览器输入indexAction!execute.action,便会执行indexAction类里的execute方法,这样虽然方便,但可能带来安全隐患,通过url可以执行Action中的任意方法。 想要禁止调用动态方法,则要在struts.xml中通过constant元素将 阅读全文
posted @ 2016-12-26 09:07 唯一520 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 第一点:Java代码实现文件上传 String newfileName = null; String newpathname=null; String fileAddre="/numUp"; try { InputStream stream = file.getInputStream();// 把文 阅读全文
posted @ 2016-12-26 08:53 唯一520 阅读(260) 评论(0) 推荐(0) 编辑