strtus2 标签 : 的用处

  1. 关键字:s:url     request_locale
  2. 1 -------------------------------------------------------------   
  3. <s:url id="csadetail_jump" action="csadetail_jump" namespace="/portin" includeParams="all"    
  4.   
  5. />   
  6. function onContinue(){   
  7.     window.location.href="${csadetail_jump}&csa=" + getCsa();   
  8. }   
  9.   
  10.   
  11. 2-------------------------------------------------------------   
  12. <s:url id="csa_detail_search" action="csadetailsearch_ajax" namespace="/ajax"  
  13.     includeParams="none" />   
  14. $.ajax({ url:"${csa_detail_search}?   
  15.   
  16. cmd=queryCsa&street="+street+"&state="+state+"&city="+city+"&zip="+zip,   
  17.               type:"get",              
  18.              dataType:"html",   
  19.              data:"",   
  20.              success:function(msg){    
  21.                                  $("#dv").html(msg);   
  22.                               }    
  23.          });   
  24. }  
1 -------------------------------------------------------------
<s:url id="csadetail_jump" action="csadetail_jump" namespace="/portin" includeParams="all" 

/>
function onContinue(){
    window.location.href="${csadetail_jump}&csa=" + getCsa();
}


2-------------------------------------------------------------
<s:url id="csa_detail_search" action="csadetailsearch_ajax" namespace="/ajax"
    includeParams="none" />
$.ajax({ url:"${csa_detail_search}?

cmd=queryCsa&street="+street+"&state="+state+"&city="+city+"&zip="+zip,
              type:"get",           
             dataType:"html",
             data:"",
             success:function(msg){ 
                                 $("#dv").html(msg);
                              } 
         });
}

 

Java代码 复制代码
  1. 3.-----------------------strust2国际化   
  2. <s:url id="url" action='switchLanguage' namespace='/' includeParams="none">   
  3.     <s:param name="request_locale">en_US</s:param>   
  4. </s:url>   
  5.   
  6. //在你的action : switchLanguage里面传递参数 request_locale    
  7.  //会strust2的  i18n 拦截器会自动获取这个参数,对Locale进行设置   
  8.   
  9. //你也可以手动设置 :    
  10. ActionContext.getContext().setLocale(new Locale("zh","CN"));   
  11.   
  12. //取出URL的值 :    
  13. <frame src="${url}" name="mainFrame" id="mainFrame" /> 

你可能感兴趣的:(html,Ajax)