首先是點擊事件
var btn = '<a class="editcls" onclick="editRow(\''+rec.tiName+'\')"href="javascript:void(0)">排考</a>';
/** 跳轉到排考*/
function editRow(tiName){
//alert(title);
console.log("editRow");
console.log(tiName);
$('#rightP').panel({
title:'排考',
href:'yyj/pk?tiName='+tiName,
left:0,
collapsible:false
});
}
/*排考*/
@RequestMapping("/pk")
public String yyj_pk(HttpSession session,HttpServletRequest request,HttpServletResponse response) throws UnsupportedEncodingException{
System.out.println("ControllerColumnitem - yyj_pk");
System.out.println("tiName="+request.getParameter("tiName"));
session.setAttribute("tiName",request.getParameter("tiName"));
session.getAttribute("tiName").toString();
// String tiName=(String)request.getAttribute("tiName");
return "yyj_ksxxwh/pk";
}
最後在下一個頁面接收值 但是出現了亂碼 該如何解決啊
用encodeURIComponent編碼2次,java再解碼,看這個:http://blog.csdn.net/whaosy/article/details/8776197
href:'yyj/pk?tiName='+encodeURIComponent(encodeURIComponent(tiName)),