首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

获取地址栏URL,传送给action

2012-10-09 
获取地址栏URL,传递给actionscript typetext/javascriptfunction QueryString() {var str location

获取地址栏URL,传递给action
<script type="text/javascript">
    function QueryString() {
var str = location.href;//获得浏览器地址栏URL串
document.getElementById("top_site_id").value=str;
}
</script>  
<input type="hidden" name="url" id="top_site_id"/>

@Result(name = SUCCESS, type = "redirect", location = "${url}"

-----------------------------相关--------------------------------
<action name="save"
   method="save">
    <result name="success" type="redirect">edit.action?xyxx.xyId=${xyxx.xyId}
    </result>
  </action>

====================

new String(queryString.getBytes("ISO-8859-1"), "UTF-8")

@Result(name = "testRedirect1", type = "redirectAction", location = "workload!test2" , params = {"testChinese","${testChinese}"})

========================================
<%
String  realPath1  =  "http://"  +  request.getServerName()  +  ":"  +  request.getServerPort()  +  request.getContextPath()+request.getServletPath().substring(0,request.getServletPath().lastIndexOf("/")+1);
%>
<input type="hidden" name="url" value="<%=realPath1  %>"/>

热点排行