|
private static String[] COLOR = { "'AFD8F8'", "'F6BD0F'", "'8BBA00'",
"'FF8E46'", "'008E8E'", "'D64646'", "'8E468E'", "'588526'",
"'B3AA00'", "'008ED6'", "'9D080D'", "'A186BE'" };
服务端代码:
@Action(value = "/imageload")
public String imageLoad ()throws Exception {
File f = new File ("d:/down.jpg");
FileInputStream in = new FileInputStream (f);
byte[] b = new byte[in.available()];
in.read(b);
HttpServletResponse response = ServletActionContext.getResponse();
// response.setCharacterEncoding("UTF-8");
response.setContentType("image");
OutputStream pwt = response.getOutputStream();
pwt.write(b);
pwt.flush();
pwt.close();
return null;
}
客户端代码:
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
</head>
<body>
<img id="img1" src=""></img>
<script type="text/javascript">
function load() {
$('#img1').attr('src', 'subject/imageload.action');
}
</script>
<button onclick=load();>点击获取</button>
</body>
</html>
问题又始于IE与Firefox
试问你用一个最新版的Firefox去与远古级的IE6做比较有意义么,
可是偏偏有许多人喜欢这么去比较,借此来宣传Firefox.
马克思说了很多费话,但还是有一句说的蛮对的,我们要辩证地看待事物.
刘翔他跑了世界冠军破了世界纪录也与我无关,
临场退赛也与我无关,他跑了第一也不代表黄种人就怎么怎么样了
我一直用IE 我也用Firefox 我也用Chrome 我也用Safari
我也不用杀毒软件,我也不中木马病毒.
我就知道,倒卖大蒜,白痴都能挣钱,我也知道,程序员同样龙鱼混杂.我们很少听到龙啸,看到的都是鱼在冒泡.
每天都是IE与Firefox ,Windows与Linux, C与Java
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
/** *//**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Main
.ListFilesInDirectory("E://WorkShop/source");
}
static void ListFilesInDirectory(String path) {
File file = new File(path);
File[] files = file.listFiles();
for (File fl : files) {
if (fl.isDirectory())
ListFilesInDirectory(fl.toString());
else {
if (fl.getName().endsWith("java")) {
System.out.println(fl.getName());
try {
Main.ReadFile(fl);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
public static void ReadFile(File f) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(f)));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(new File("d://output1.txt"), true)));
String tmp = new String();
while ((tmp = br.readLine()) != null) {
if (tmp.matches("\\s+") || tmp.length() == 0)
continue;
if (tmp.matches("^\\s*(/\\*).*") || tmp.matches("^\\s*\\*.*")||tmp.matches("^\\s*//.*")
|| tmp.matches("^\\s+\\*/.*")){
continue;
}
bw.write(tmp);
bw.newLine();
}
br.close();
bw.close();
}
}
新安装了一个FlexBuilder3
可是在运行 Application的时候 报出
CreateProcess: "%ProgramFiles%\Internet Explorer\iexplore.exe" G:\java\Flex\........html error=2
Error=2好像是Windows系统返回的错误
且不去管他. ~
打开Eclipse的--Preferences---General---Web Browser---将Default system Web browser 修改成Internet Explorer或Firefox
问题得以解决 `~
至此问题原因 也很明了
因为我的系统已经使用了很多年了~ Windows默认的是IE6吧~ 已经早就升级成了IE8 但是参数Default Web Browser应该还是指向IE6 , 所以出了问题~~
与Eclipse无关~~
下载地址:dl.google.com/chrome/install/472.53/chrome_installer.exe
472.53为Chrome版本号
set names 'utf8' ;
alter database databaseName character set utf8;
create database mydb character set utf8;
set character_set_client=utf8;
set character_set_connection=utf8;
set character_set_database=utf8;
set character_set_results=utf8;
set character_set_server=utf8;
set collation_connection=utf8_unicode_ci;
set collation_database=utf8_unicode_ci;
set collation_server=utf8_unicode_ci;
|