1、
通過get發放傳遞中文參數時會有亂碼產生。避免此問題的方法一種是更改tomcat中設置。另一種是改get為post
tomcat中應該修改配置文件server.xml中的編碼設置為:utf-8或者GBK
//代碼
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" URIEncoding="UTF-8或GBK"/>
2、
解決下載附件時文件名中文亂碼問題 需要在設置下載文件時把名字的編碼改為"ISO8859-1"
//代碼
JspFileDownload jfd = new JspFileDownload();
jfd.setResponse(response);
jfd.setDownType(0);
jfd.setDisFileName(URLEncoder.encode(request.getParameter("filename"),"ISO8859_1"));
3、
在一塊<span/>中使鼠標移上之后便手指是在span塊中加入
<span style="cursor:hand"></span>
使其變色為
<span style="color:blue"></span>
4、
通過JS使頁面跳轉其中一個方式
window.location.href="";
用JS打開一個新窗口
window.open("地址", "popupwin", "height="+h+", width="+w+
", top="+top+", left="+left+", toolbar=0, menubar=0, scrollbars=1, resizable=0,location=0, status=1");
強制刷新父頁面并且關閉本窗口
window.opener.location.href=window.opener.location.href;
window.close();
5、
servlet中的跳轉頁面
request.getRequestDispatcher("地址").forward(request,response);
6、
這是一個HQL查詢方法
public List<SysInfomation> findByUser(String user, int pageCount, int page) {
// TODO Auto-generated method stub
String hql = "from SysInfomation f where f.style = 1 and (f.fankuiren = '"+ user + "' or f.shoujianren = '" + user +"') order by f.isread";
return super.find(hql, null, pageCount, page);
}
posted on 2008-06-30 21:55
leweslove 閱讀(208)
評論(0) 編輯 收藏 所屬分類:
Other