20090812(jsp+servlet+access)Topjoy遇到的问题

1.
上传文件 form要是 ENCTYPE="multipart/form-data"

2.
select top 2 * from history inner join user on history.userid=user.id where user.username='admin' order by history.id desc
连接,降序排列

3.
select distinct  industry.id ,industry.Industry from case inner join industry on industry.id=case.IndustryId order by industry.id
连接+除去重叠的记录

4.
jspsmartupload 如果有多个文件的<input file~~ />
就一直顺序排下来,
com.jspsmart.upload.File file1 = upload.getFiles().getFile(0);
String FileName1 = file1.getFileName();
com.jspsmart.upload.File file2 = upload.getFiles().getFile(1);
String FileName2 = file2.getFileName();

无值的就FileName1.equals("") = true

5.
if(feildName.equals("bigImg"))  比较的是值相等不  (一般用这个)
if(feildName=="bigImg")    比较的是是不是同一字符串

6.
页面传递的参数
String ID = request.getParameter("id");
System.out.println(ID);
System.out.println(ID!=null);
System.out.println(ID!="");
if(ID!=null&&ID!="")

XXX.jsp的结果
null
false
true
XXX.jsp?id=1的结果
1
true
true
XXX.jsp?id= 或 XXX.jsp?id 的结果
true
false

7.
DOM 通过创建树来表示文档,从而使开发者对文档的内容和结构具有空前的控制力。用 DOM API 可以轻松地删除、添加和替换节点。

document.getElementById('header').style.color="red"
document.getElementById('image').src="/i/eg_landscape.jpg"
src是属性,可见style是一属性,color是style的一属性

8.
javascript with用法
http://www.iteye.com/topic/222362

with (object)
   statements
参数
object
新的默认对象。
statements
一个或多个语句,object 是该语句的默认对象。
说明
with 语句通常用来缩短特定情形下必须写的代码量。在下面的例子中,请注意 Math 的重复使用:

x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * Math.E)
当使用 with 语句时,代码变得更短且更易读:

with (Math){
   x = cos(3 * PI) + sin (LN10) 
   y = tan(14 * E)
}

9.
如何在提交的表单中添加“在新窗口中打开页面”的属性?
<form name="searchform" method="post" action="search_list.asp" target="_blank">
和在新窗口打开链接一样,加个target="_blank"
http://zhidao.baidu.com/question/10524729.html

10.
中文汉字在占多少个字节(byte)?
http://topic.csdn.net/u/20081119/20/a9152e49-5e59-4a81-86a1-936c1d1e7c45.html

char[] charData = {'我'};
byte[] byteData = new byte[3];
Encoder e = Encoding.UTF-8.GetEncoder();
e.GetBytes(charData,0,1,byteData,0);
foreach(byte a in byteData){
Console.WriteLine(a);
}
结果是三个0-255的数字,即三个两位16进制的的数,即三个字节,请问我这样分析有什么问题?

对的,所以说的是要看是什么编码,你用的是UTF-8,大伙说的大多都是ANSI和UNICODE,在这两种编码中是2位,日常用得最多的也是这两种。

如果是unicode,任何字符都占两个,包括字母数字等

看是多少位的os了 ,32位的应该是2个吧

你可能感兴趣的:(JavaScript,jsp,servlet,OS,Access)