This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Needs to access array from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Needs to access array from servlet" Watch "Needs to access array from servlet" New topic
Author

Needs to access array from servlet

Lekshmanan Suresh
Greenhorn

Joined: Apr 04, 2012
Posts: 2
Dear all,

i am facing problem for posting row data from the forms to database via servlet.
also, i have stored all the elements in the jsp. How do i access from servlet.


See below of my codings:


var myArray = new Array((document.forms[0].length)-14);

var abc = myArray.length

alert(abc);

for(i=13;i<document.forms[0].length;i++){
myArray[i]= document.forms[0].elements[i].value;
// alert(myArray[i]);
}

for(i=13;i<myArray.length;i++){
// alert(i);
alert(myArray[i]);
}

I wanted to retrieve the myArray values from sevlet after submiting the form, Please need help also suggest me the optimum way to perform.


Rgards

Suresh
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
The code you have posted is java script code. What is your problem, you are having dificulty in submitting values from HTML or displaying values on HTML via Servlet?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Needs to access array from servlet
 
Similar Threads
Sorting Issue Help Needed Badly
Checking for unique values in an array
Three dim array
Arrays doubt
What does the dimension of an array refer to?