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 阅读(198) 评论(0)  编辑  收藏 所属分类: Other

只有注册用户登录后才能发表评论。


网站导航:
 
Copyright@2008-2009 By Evan