<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    成功捷徑,貴在堅持
    人為善,福雖未至禍已遠離; 人為惡,禍雖未至福已遠離

    ??????昨天遇到一個問題讓我困惑了半天,window.open("url?param="+paramvalue)傳遞參數出現亂碼,以前從沒有遇到過這種問題,在客房端顯示是正常的,可是到服務端就是亂碼,不管用什么方式轉碼都不行,經過和同事一翻調試,最后想到了一個js在客戶端轉碼的函數,escape(str);但是傳到服務端仍然是亂碼,必須在服務端進行解碼。服務端執行request.setCharacterEncoding("utf-8");或GBK,這樣傳過來的參數就不用轉碼也是中文了。唉,總算功夫沒有白費!
    ?window.open("WindowCustomerListAction?username="+encodeURIComponent(form1.name.value), "customerList", "width=550,height=250,scrollbars=yes,resizable=yes,status=yes");
    服務端
    public class WindowCustomerListAction extends AbstractAction{
    ?/**
    ? * (non-Javadoc)
    ? *
    ? * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector,
    ? *????? org.apache.cocoon.environment.SourceResolver, java.util.Map,
    ? *????? java.lang.String, org.apache.avalon.framework.parameters.Parameters)
    ? */
    ?public Map act(Redirector redirector, SourceResolver resolver,
    ???Map objectMode, String source, Parameters param) throws Exception {
    ??// TODO Auto-generated method stub
    ??Request request = ObjectModelHelper.getRequest(objectMode);
    ??String userName = request.getParameter("username")==null?"":request.getParameter("username").trim();
    ??//獲得要顯示的頁碼
    ??String showpage = request.getParameter("showpage") == null ? "1"
    ????: request.getParameter("showpage");
    ??//客戶信息接口
    ??ThProcessCustomerDAO customerDao = (ThProcessCustomerDAO) AppSqlConfig
    ????.getDaoManagerInstance().getDao(ThProcessCustomerDAO.class,
    ??????"sqlmap");
    ??//獲得客戶列表
    ??ThProcessCustomerExample example = new ThProcessCustomerExample();?
    ??example.setName("%"+userName+"%");
    ??example.setName_Indicator(ThProcessCustomerExample.EXAMPLE_LIKE);??
    ??List customerlist = customerDao.selectByExample(example);??
    ??int count = customerlist.size();
    ??
    ??//分頁
    ??PageControl pageControl = new PageControl();
    ??pageControl.setPageSize(10);
    ??pageControl.setRowCount(count);
    ??pageControl.setRequestUrl("WindowCustomerListAction?userName="+userName+"&amp;showpage=");
    ???????
    ??pageControl.setShowPage(Integer.parseInt(showpage));

    ??request.setAttribute("pageControl", pageControl);
    ??request.setAttribute("customerlist", customerlist);
    ??return null;
    ?}
    }

    posted on 2006-08-02 08:18 選寶網an9 閱讀(2891) 評論(2)  編輯  收藏 所屬分類: JAVA

    FeedBack:
    # re: window.open("url?param="+paramvalue)亂碼[未登錄]
    2009-06-01 12:25 | michael
    URL encoding 一下就好了
      回復  更多評論
      
    # re: window.open("url?param="+paramvalue)亂碼
    2009-07-24 18:16 | huliang
    不會吧?你這樣就有用  回復  更多評論
      
    主站蜘蛛池模板: 国产91色综合久久免费分享| 中文字幕乱码免费看电影| 91在线老王精品免费播放| 久久综合图区亚洲综合图区| a国产成人免费视频| 亚洲愉拍一区二区三区| 曰韩无码AV片免费播放不卡| 日本高清免费不卡在线| 国产成人精品日本亚洲网址| 日韩欧美亚洲中文乱码| 成人免费区一区二区三区| 亚洲日韩精品无码专区网站| 亚洲综合久久成人69| 99re8这里有精品热视频免费| 国产精品免费_区二区三区观看| 妞干网免费视频在线观看| 亚洲AV永久青草无码精品| 国产成人免费AV在线播放| 亚洲性久久久影院| 本道天堂成在人线av无码免费| 亚洲不卡无码av中文字幕| 特黄aa级毛片免费视频播放| 国产91在线免费| 免费在线视频一区| 亚洲a级成人片在线观看| 中文字幕乱码免费视频| 亚洲乱亚洲乱妇无码麻豆| 亚洲日韩国产AV无码无码精品| 最近免费中文字幕4| 亚洲AV第一成肉网| 亚洲国产精品成人| 久久久久久噜噜精品免费直播 | 国产网站免费观看| 亚洲国产精品无码观看久久| 国产精品免费无遮挡无码永久视频 | 日日躁狠狠躁狠狠爱免费视频 | 亚洲五月午夜免费在线视频| 中文字幕亚洲乱码熟女一区二区| 永久免费AV无码网站国产| 亚洲视频一区二区在线观看| 国产在线jyzzjyzz免费麻豆|