2012-12-20 44 views
0

假設
無法從JSP頁面獲取的參數值

回到Home.jsp代碼包含類似

<input name="R" onclick="del(<%=rs.getString("VDB")%>)" type="radio" value="<%=rs.getString("VDB")%>" /> 

// 按鈕:我傳遞VDB的價值德爾()

它調用javascript爲:

<script type="text/javascript"> 
function del(delno) 
{ 
var ff = document.vendorform; 

var url = "delete.jsp?+vendor="+delno; 
window.navigate("delete_vendor.jsp?+vendor="+delno); 

//window.location.href="delete_vendor.jsp?+vendor="+delno; 
//ff.method = "POST"; 
//ff.action ="delete_vendor.jsp?+vendor="+delno; 
//ff.submit(); 
}//i have used 3 methods to redirect to delete.jsp 


delete.jsp:
此頁我要檢索廠商的價值我用:

String D1=request.getParameter("vendor"); 

但是,讓空值。
任何幫助

回答

1
var url = "delete.jsp?+vendor="+delno; 

你插錯串+vendor。它應該只在url中有vendor

var url = "delete.jsp?vendor="+delno; 
+0

感謝ü這麼多,它正在F9 :) – lata

+0

u能請告訴會話爲什麼點擊一個鏈接(錨標記)我的會話值獲得空 – lata

+0

歡迎你以後@ lata :) –

1

去掉 「+」 字之前的供應商。更改

var url = "delete.jsp?+vendor="+delno; 

var url = "delete.jsp?vendor="+delno; 
相關問題