- 浏览: 58524 次
- 性别:
- 来自: 北京
-
最新评论
文章列表
需求:serlvet经过处理通过报表工具返回一张报表图(柱状图 折线图)。
现在需要把这个图存储到本地 以便随时查看
// 构造URL
URL url = new URL(endStr);
// 打开URL连接
URLConnection con = url.openConnection();
// 得到URL的输入流
InputStream input = con.getInputStream();
// 设置数据缓冲
byte[] bs = new byte[1024 * 2];
// 读取到的数据长度
int len;
// 输 ...
1.报错如下:
java.io.FileNotFoundException: D: (拒绝访问。)
解决:在设置File file=new File(str); str的时候需要把str精确掉某个文件。例如str="D:"是错误的,应该是 str="D:\\a.txt"
//判读一个对象是否存在
if(document.getElementById("ytlx")){}else{}
//在页面获取鼠标点击的位置
function show_coords(event) { x=event.clientX y=event.clientY alert("X 坐标: " + x + ", Y 坐标: " + y) }<body onmousedown="show_coords(event)">
//是js同步加载
DWR ...
Dwr.xml模板:
<?xml version="1.0" encoding="UTF-8"?><!-- 说明这是一个xml文档,1.0版本,文档采用UTF-8的编码格式 -->
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.ltd.uk/dwr/dwr20.dtd">
<!-- 说明这个xml文档要遵循的格式是dwr配置文 ...
http://u.115.com/file/f48dd72edc# 第一课http://u.115.com/file/f4e343188d# 第二课http://u.115.com/file/f4e3f2cb55# 第三课http://u.115.com/file/f41c9f3a78# 第四课http://u.115.com/file/f472e00606# 第五课http://u.115.com/file/f485127eae# 第六课http://u.115.com/file/f4481fd3c9# 第七课http://u.115.com/file/f4f1659bcd# 第八课http: ...
DataSource dataSource=new DataSource();
dataSource.setClientOnly(true);//必须有
dataSource.setFields(new DataSourceTextFiled("setId","setTitle"));
final DynamicForm form=new DynamicForm();
form.setUseAllDataSourceFields(true);//必须有
form.setDataSource(dataSource);//必须 ...
前台代码 (smarGwt):
public DataSourceTextField DataSourceDateFieldUploadingPic(String timeId,String timeName){
//SC.showConsole();
//"file"
new DataSourceValidateFile();
textuploadFile=new DataSourceTextField(timeId,"<nobr>"+timeName+"</nobr>&q ...
DateTimeFormat.getFormat("yyyy/MM/dd").format( meeting.getDateOfBirth())
DateTimeFormat.getFormat("yyyy/MM/dd").format( 所返回来的日期类型)
匹配中文字符的正则表达式: [\u4e00-\u9fa5]评注:匹配中文还真是个头疼的事,有了这个表达式就好办了
匹配双字节字符(包括汉字在内):[^\x00-\xff]评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)
匹配空白行的正则表达式:\n\s*\r评注:可以用来删除空白行
匹配HTML标记的正则表达式:<(\S*?)[^>]*>.*?</\1>|<.*? />评注:网上流传的版本太糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套标记依旧无能为力
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import javax.swing.Borde ...
1 关于判断:
"已经审核".equals(mark); ["正确形式"]
mark.equals("已经审核"); ["错误形式"] 可能引起空指针异常
2 日期
当new Date().getTime();不能满足你的时候,可以试试
Calendar a=Calendar.getInstance();
a.set(Calendar.HOUR_OF_DAY, 0);
a.set(Calendar.MINUTE, 0);
...
下列代码实现的是 一个下拉列表的功能:
package com.tservice.PGA.smApp.client.Meeting;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.smartgwt.client.data.fields.DataSourceEnumField;
import com.smar ...
这是前台前台展示页面(smartGwt):
//生日提醒
Timer timer=new Timer(){
public void run(){
mainService.Timing(null,new AsyncCallback(){
public void onFailure(Throwable caught) {
}
public void onSuccess(Object result) {
String str=(String)result;
Date day=new Date ...
导入存储过程
mysql > use 填写你的数据库名称;
mysql > source 填写你*.sql文件地址;
删除表结构
mysql > use 填写你的数据库名称;
mysql > drop table 填写你的表名称;
查看表结构
mysql > use 填写你的数据库名称;
mysql > desc 填写你的表名称;
从表中找出来不重复的ID(抛出重复的,只保留一个)
select DISTINCT F_DATAID from TB_BAS_TFJBXX;