Java
文章平均质量分 61
feng8008
没心没肺
展开
-
poi写excel文件
public void createReport(ResultSet rs) { try { ResultSetMetaData rsmd = rs.getMetaData(); //获得数据集的列数 int numbercols=rsmd.getColumnCount(); rs.last(); //将数据集游原创 2007-08-22 09:22:00 · 663 阅读 · 0 评论 -
AJAX防止页面缓存
采用AJAX技术的时候 通常我们无刷新页面提交数据后 用同样的url去获取数据的时候会发现是以前的数据~那样就给client端带来假象了~~ 采用以下的方法可以取消缓存htm网页 或者 asp网页 response.expires=-1 response.expiresabsolute=now()-1 response.cachecontrol="no-cache" php网页 head转载 2008-05-26 17:49:00 · 951 阅读 · 0 评论 -
jsp获取客户端信息
String Agent = request.getHeader("User-Agent");StringTokenizer st = new StringTokenizer(Agent,";");st.nextToken();//得到用户的浏览器名String userbrowser = st.nextToken();//得到用户的操作系统名String useros = st.nextToke原创 2007-09-26 10:08:00 · 645 阅读 · 0 评论 -
java调用chm文件
try{Runtime.getRuntime().exec("cmd /c start C://help.chm");Desktop.getDesktop().open(new File("C://help.chm"));}catch(Exception e){ System.out.println(" execption");};原创 2007-09-20 14:23:00 · 1992 阅读 · 0 评论 -
strus+ajax实例--用户注册(4)
4.写action/* * Generated by MyEclipse Struts * Template path: templates/java/JavaClass.vtl */package com.user;import java.io.IOException;import java.io.PrintWriter;import java.io.UnsupportedEncodingExc原创 2007-09-19 14:20:00 · 608 阅读 · 0 评论 -
strus+ajax实例--用户注册(3)
5.写js文件reg.js (ajax与struts的action交互)如下:/** * @author marten * @copyright:marten9-19 */ var XMLHttp; function createXMLHttpRequest(){ if (window.XMLHttpRequest) XMLHttp = new X原创 2007-09-19 14:15:00 · 618 阅读 · 0 评论 -
strus+ajax实例--用户注册(2)
4.写jsp文件userReg.jsp如下: User Regisiter function showadv(){ if(document.regForm.advshow.checked == true) adv.style.display = "";原创 2007-09-19 14:13:00 · 733 阅读 · 0 评论 -
strus+ajax实例--用户注册(1)
1.新建工程userReg2.添加struts3.配置struts.配置后的struts-config.xml文件如下: attribute="UserForm" input="/user/userReg.jsp" name="UserForm" path="/userReg" scope="request"原创 2007-09-19 14:11:00 · 837 阅读 · 0 评论 -
jstl in action 第一章 (转自http://www.blogcn.com/blog/trackback.asp?mydiary=23140833 )
PART I背景知识在此书的第一部分,我们将概览jstl的概念和它的工作机制。我们将从讨论网页的动态内容开始,然后比较html和xml的区别。这一步很重要,因为jstl使用了类似xml的语法,所以你必须了解它的规则。最后我们将讨论jsp基础,它是jstl植根其上的语言。第一章:动态网页内容动态网页内容的概念I.jstl看上去象什么II.运行jstl的前提III.jstl在web应用中的角色一个ht转载 2007-09-13 08:57:00 · 5879 阅读 · 1 评论 -
jstl in action 第二章(转自http://www.blogcn.com/blog/trackback.asp?mydiary=23140875)
第二章:xml、jsp基础本章内容:I.xml基本语法II.jsp介绍III.context中的jstl标签库IV.jsp范围变量2-1xml介绍首 先要提一下html。html拥有一套标签,如,标签拥有修饰符或成为属性(attribute)。如在标 签中的src="/dir/a.jpg"。html标签拥有一定的结构,如不能出现在之前。因此,我们可以说,html是一个标签、标签属性和结构规则的 集转载 2007-09-13 08:59:00 · 7227 阅读 · 0 评论 -
poi读excel文件
package src; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.hssf.record.*; import org.apache.poi.hssf.model.*; import org.apache.poi.hssf.util.*原创 2007-08-22 09:24:00 · 1987 阅读 · 0 评论 -
AJAX responseText乱码解决
今天碰到一个郁闷的问题:AJAX GET 到struts action返回responseText 时出现乱码????问题google下,网友们提供了几种解决办法:1.设置返回的编码格式:response.setHeader("Charset","GBK");2.把服务器端和客户端编码格式都统一设为utf-8,检查我的代码,我的都是utf-8的,照理符合第2种情况,不应该出原创 2008-05-27 11:06:00 · 1984 阅读 · 0 评论