पर जावास्क्रिप्ट सरणी पास करने के लिए मैंने SO पर इस विषय पर पिछले प्रश्नों को देखा है, लेकिन मेरी समस्या अभी तक हल नहीं हुई है।सर्वलेट
मैं जावास्क्रिप्ट से सर्वलेट में सरणी पास कर रहा हूं।
जावास्क्रिप्ट कोड:
var action = new Array();
function getProtAcionValues(rowNo,columnCount)
{
for(var j=0;j<columnCount;j++)
{
action[j] = document.getElementById('textActions'+rowNo+''+j).value;
alert(action[j]);
}
}
सर्वलेट कोड:
String actions[] = request.getParameterValues("action[]");
if(actions!=null)
for(int i=0;i<actions.length;i++)
{
System.out.print(" Action: "+actions);
}
else
System.out.println("Action is null");
कोड मैं संदेश हो रही है इसके बाद के संस्करण का उपयोग करना "कार्रवाई शून्य है"।
और अगर मैं कोशिश
String actions[] = request.getParameterNames("action[]");
मैं सिंटेक्स त्रुटि हो रही है:
The method getParameterNames() in the type ServletRequest is not applicable for the arguments (String)
कृपया मुझे बताएं कि वहाँ कुछ कोड में गलत है करते हैं।
का उपयोग कहां है HTML या जावा स्क्रिप्ट कोड है कि सर्वलेट कॉल? – home
क्या आप कोड को पोस्ट कर सकते हैं कि आप servlet में एक्शन एरे कैसे भेज रहे हैं ... –