导航

2012年11月16日

摘要: find基本作用:遍历输出所有指定路径下的文件(包括子文件及文件夹)示例:1. find path 结构: 例:find . 遍历输出当前目录下的所有文件(夹)及子文件(夹) find / 遍历输出根目录下的所有文件(夹)及子文件(夹) find ./ 遍历输出当前目录的下一级路径的所有文件(夹)及子文件(夹) 2. find path -type f 遍历输出path路径下的所有普通文件及子文件 find path -type d 遍历输出path路径下的所有路径(即文件夹) find path -name "cou*" 遍历输出path路径下的所有包含"cou 阅读全文

posted @ 2012-11-16 16:10 阿里大盗 阅读(613) 评论(0) 推荐(0)

摘要: 1. File file = new File("C:/xxx.tct"); //创建一个file对象 2. 读取文件: 【】 FileInputStream fis = new FileInputStream(file); fis方法介绍: (1)int i = fis.read(); //读取xxx.txt文件的第一个字节,并以ascii码数值表示;若文件txt为空,则返回-1。(例:txt文件中首字节为"a",则i=97) (2)public int read(byte[] b) //本方法是以字节为单位,来读取文件中的内容。并将读到的内容以asc 阅读全文

posted @ 2012-11-16 16:04 阿里大盗 阅读(179) 评论(0) 推荐(0)

摘要: DB-->屏幕: public static void main(String[] args){ String url ="jdbc:mysql://localhost/bookdb"; String username = "dbuser"; String password = "1234"; String sql = "select name from customers where cid>=4"; try { Class.forName("org.gjt.mm.mysql.Driver& 阅读全文

posted @ 2012-11-16 16:02 阿里大盗 阅读(133) 评论(0) 推荐(0)

摘要: ext-API:http://localhost/ext3.0/docs/index.html(需要Tomcat部署) ext-各种界面元素图片示例:http://localhost/ext3.0/examples/index.html项目struts2_3000_BBS2009_01中的ext界面设计:WebRoot/admin/index.html整个界面是一个Viewport,组件包括:Ext.Panel等。在Ext.Panel中有多种样式的选择,可以参见http://localhost/ext3.0/examples/index.html,项目中选用了accordion ,同时也可以设 阅读全文

posted @ 2012-11-16 15:56 阿里大盗 阅读(186) 评论(0) 推荐(0)

摘要: create table 表名{ id int(8), name varchar(20) };基础查询:select id,name from 表名 where 表达式 order by id desc; 解释:select(必须)指定查询/提取结果集中的字段 from(必须)指定查询目标表 where(可选)限定查询条件 order by(可选)查询结果排序 顺序:根据from找到目标表,根据where过滤可以被查询的内容,根据select读出/查询字段内容,根据order by对结果集进行排序(默认升序,desc是降序)where后的表达式:id>4 id between 3 ... 阅读全文

posted @ 2012-11-16 15:54 阿里大盗 阅读(163) 评论(0) 推荐(0)

摘要: result类型(常用2-4种)见其它随笔。global-results(全局结果集)使用方法:<package name="user" namespace="/user" extends="struts-default"> <global-results> <result name="mainpage">/main.jsp</result> </global-results> <action name="index"> & 阅读全文

posted @ 2012-11-16 15:47 阿里大盗 阅读(801) 评论(0) 推荐(0)

2012年10月25日

摘要: dispatcher:服务器端跳转,地址栏不变redirect:客户端跳转,地址栏改变chain:可以跳转至Action(包括同namespace/package name 和 不同namespace的Action)。eg.<package name="public" extends="struts-default"> <!-- Chain creatAccount to login, using the default parameter --> <action name="createAccount" 阅读全文

posted @ 2012-10-25 10:32 阿里大盗 阅读(285) 评论(0) 推荐(0)

摘要: 方法:Action实现RequestAware,SessionAware等,属性Map, 并override相应方法(public void setSession)。eg.package com.bjsxt.struts2.user.action;import java.util.Map;import org.apache.struts2.interceptor.ApplicationAware;import org.apache.struts2.interceptor.RequestAware;import org.apache.struts2.interceptor.SessionAwar 阅读全文

posted @ 2012-10-25 10:04 阿里大盗 阅读(204) 评论(0) 推荐(0)

摘要: <action name="*_*" class="包名.{1}action" method="{2}"> <result>/{1}_{2}_success.jsp</result></action> 阅读全文

posted @ 2012-10-25 09:48 阿里大盗 阅读(104) 评论(0) 推荐(0)

摘要: 1.<action name="hgt" class=“com.sd.er.MyAction” >当Struts2找到需要的Action时,会自动创建MyAction类的对象,并执行其中的某个方法(public String xxx),获得返回值(默认“success”),根据 返回值调用相应得result。2.Action类需要继承ActionSupport,Action执行时默认调用execute(),但是可以method=""指定,或者DMI(动态方法调用:eg. <%=context%>/.../.../uesr!add 阅读全文

posted @ 2012-10-25 09:39 阿里大盗 阅读(130) 评论(0) 推荐(0)