strtus2 标签 : 的用处

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);
                              } 
         });
}

 

3.-----------------------strust2国际化
<s:url id="url" action='switchLanguage' namespace='/' includeParams="none">
	<s:param name="request_locale">en_US</s:param>
</s:url>

//在你的action : switchLanguage里面传递参数 request_locale 
 //会strust2的  i18n 拦截器会自动获取这个参数,对Locale进行设置

//你也可以手动设置 : 
ActionContext.getContext().setLocale(new Locale("zh","CN"));

//取出URL的值 : 
<frame src="${url}" name="mainFrame" id="mainFrame" />

 

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