上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 一、Query查询可以先设定查询参数,之后通过set等方法,将指定的参数值添入.还可以使用命名参数Session session = sessionFactory.openSession();Query query = session.createQuery("select user.name from User as user where user.age>?( :minAge )");quer... 阅读全文
posted @ 2007-05-14 10:37 王永庆 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 1、读取配置文件获得连接 读取hibernate.cfg.xml配置文件,hibernate.cfg.xml文件放在Classpath下,使用下面的方式读入该文件 //Configuration 负责管理hibernate配置信息 Configuration config=new Configuration().configure(); //根据config建立S... 阅读全文
posted @ 2007-05-11 17:22 王永庆 阅读(885) 评论(0) 推荐(0) 编辑
摘要: (1)设置 在从服务器返回数据的同时,还要进行设置,使浏览器不会在本地缓存结果,response.setHeader("Cache-Control","no-cache");response.setHeader("pragma","no-cache"); XMLHttpRequest对象提供2个可以用来访问服务器响应的属性,一个是responseText将响应提供一个串,结... 阅读全文
posted @ 2007-05-11 13:59 王永庆 阅读(276) 评论(0) 推荐(0) 编辑
摘要: (1)字体属性: 字体名称属性 (font-family) {font-family:Arial}可选项:caption,icon ,menu ,message-box,small-caption,status-bar 字体大小属性 (font-size){font-size:16pt}最长用的就是pt,px 字体风格属性(font-style){font-sytle... 阅读全文
posted @ 2007-05-10 19:28 王永庆 阅读(230) 评论(0) 推荐(0) 编辑
摘要: (1)目录的建立/检查与删除 public void createDir(){ String path=request.getRealPath(""); path=path+"\sub";//将要建立的目录路径 File d=new File(path);//建立代表sub目录的File对象,并得到它的一个引用 if(d.exists()){ d.delete(); ... 阅读全文
posted @ 2007-05-10 14:14 王永庆 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 调用其他的可执行文件,例如:自己制作的exe,或是下载安装的软件public void RunBat(String filepath)throws Exception{ String str=filepath+"execute.bat"; try{ Process p=Runtime.getRuntime().exec(str); ... 阅读全文
posted @ 2007-05-10 13:52 王永庆 阅读(517) 评论(0) 推荐(0) 编辑
摘要: 首先,JSF也是表示层的框架,同STRUTS一样,Apache Struts框架的作者 Craig McClanahan,协助领导了Sun公司的JSF项目。从应用开发者的角度看,两种框架是很相似的,但是JSF可能将会得到更多的支持。因为JSF是Java的标准。在未来的发展中,有可能所有的J2EE应用服务器都需要支持JSF(Java Ser... 阅读全文
posted @ 2007-05-10 10:17 王永庆 阅读(1187) 评论(0) 推荐(0) 编辑
摘要: 1、在应用开发中,经常需要一些周期性的操作,比如每5分钟执行某一操作等。对于这样的操作最方便、高效的实现方式就是使用java.util.Timer工具类。 private java.util.Timer timer; timer = new Timer(true); timer.schedule(new java.util.TimerTask() { public void run() { //s... 阅读全文
posted @ 2007-04-28 13:26 王永庆 阅读(31884) 评论(6) 推荐(2) 编辑
摘要: 首先添加所需要的类包:quartz-1.5.2.jar,quartz-all-1.5.2.jar,quartz-jboss-1.5.2.jar //设置定时作业 public void startScheduler(HttpServletRequest requests)throws SchedulerException{ try{ //建立作业调度器 Scheduler schedu... 阅读全文
posted @ 2007-04-28 13:17 王永庆 阅读(7715) 评论(0) 推荐(1) 编辑
摘要: (1)、request.getRealPath("/");//不推荐使用获取工程的根路径(2)、request.getRealPath(request.getRequestURI());//获取jsp的路径,这个方法比较好用,可以直接在servlet和jsp中使用(3)、request.getSession().getServletContext().getRealPath("/");//获取工程... 阅读全文
posted @ 2007-04-28 11:32 王永庆 阅读(1502) 评论(1) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页