`
suigara
  • 浏览: 80938 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

什么都有。。。

 
阅读更多

自己机子上的,积累的一些东西,放这吧,可能有用

JSP中的HTML相关的数据区分大小写,如<img src=”aa.jpg”/><img src=”AA.JPG”/>就不相同。
持久化:通过手工或其他方式输入到应用程序中的数据,能够在应用结束运行后依然存在。即使应用运行结束或者计算机关闭后,这些信息依然存在。
三、 持久化框架、ORM(Object-Relation Mapping)和DAO(Data Access Object)设计模式的关系?
ORM是一种持久化框架;DAO是用于实现持久化框架的一种设计模式。
四、 ArrayList和Vector的区别,HashMap和Hashtable的区别
一.同步性:Vector是线程安全的,也就是说是同步的,而ArrayList是线程序不安全的,不是同步的
二.数据增长:当需要增长时,Vector默认增长为原来一培,而ArrayList却是原来的一半
Hashtable和HashMap的区别:
1.Hashtable是Dictionary的子类,HashMap是Map接口的一个实现类;
2.Hashtable 中的方法是同步的,而HashMap中的方法在缺省情况下是非同步的。即是说,在多线程应用程序中,不用专门的操作就安全地可以使用Hashtable 了;而对于HashMap,则需要额外的同步机制。但HashMap的同步问题可通过Collections的一个静态方法得到解决:
Map Collections.synchronizedMap(Map m)
这个方法返回一个同步的Map
四、 Struts里标签不能嵌套,如:
<html:text property="trueName" value="<bean:write name=”user” property=”truename”>"/> 是不合法的
如果想实现相同效果可以用EL实现
<html:text property="trueName" value="${user.trueName}"/>
另外,要在jsp页面中加上<%@ page isELIgnored="false"%>
五、<logic:iterate id="myuserlist" name="userVec">
<tr>
<td class="roomlist"><bean:write name="myuserlist" property="userName"/></td>
<td class="roomlist"><bean:write name="myuserlist" property="trueName"/></td>
</tr>
</logic:iterate>
可以循环输出userVec中的所有值
六、jdk自带的转码工具,命令如下(要配好环境变量)
native2ascii -encoding encodemethod temp.properties result.properties
example:
native2ascii -encoding gb2312 my.properties my_zh_CN.properties
七、<html:select property="minExecTimeScale" styleClass="tdstyle">
相当:<select name="minExecTimeScale" class="tdstyle">
八、 Struts中实现文件上传:
在jsp:
<html:form action=”Upload.do” method=”POST” enctype=”multipart/form-data”>
<html:file property=”myFile”>
</html:form>
在ActionForm:(FormFile是Struts自带的类,导入就可以了)
private FormFilemyFile;
public FormFile getMyFile(){return this.myFile;}
public void setMyFile(FormFile myFile){this.myFile=myFile;}
在Action:
//获取应用程序绝对路径+/upload
String dir=servlet.getServletContext.getRealPath(“/upload”);
UploadForm upff=(UploadForm)form;
FormFile myFile=upff.getMyFile();
//文件名和大小
String fileName=myFile.getFileName();
String path=dir+"/"+fileName;
InputStream in=myFile.getInputStream();
OutputStream out=new FileOutputStream(path);
//
int byteRead=0;
byte[] buffer=newbyte[1024];
while((byteRead=in.read(buffer, 0, 1024))!=-1) {
out.write(buffer, 0, byteRead);
}
out.close();
in.close();
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics