• Post Reply Bookmark Topic Watch Topic
  • New Topic

arrays  RSS feed

 
neelu jain
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have 2 JSPs :getoption.jsp and performaction.jsp.
The getoption.jsp looks like this:
name1 optionbut1(access) optionbut1(deny)
name2 optionbut2 optionbut2
name3 optionbut3 optionbut3
name4 optionbut4 optionbut4
The names and option buttons are generated depending on a set of values I get from LDAP. A submit on this page posts the data to performaction.jsp.
Mt problem is the names {nam1,name2,name3,name4} are stored in an array.
String[] names=new String[100];
How is it possible for me to access the names array in the performaction.jsp. I need to update the LDAP entry for these set of names. I try to do request.getParameter() functions but they do not work. It appears as though the array name is not know the performaction.jsp. How can I access an array from one .jsp to the page where the initial page gets posted.
I hope I have asked my question clearly.
Thanks
Neelu Jain
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The array object may be accessible to the other JSP if you send it as request attribute, or put it in the application context as attribute or as a session attribute depending on how long you want the object to be accessible.
 
S Chandra Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Are u trying to access the array of javascript or array from one page to another ?
Upto my knowledge u cannot accee the array of javascript, u have to put those values into a <select> object adn access it. I think this is the way u can do about it.
If ur requirement is diff, pls explain.
 
neelu jain
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the options. It was a JSP and there was no Javascript. I solved the problem by using a session object and ArrayList instead of array because I also needed dynamic size. It could have also been solved the same way for array also using a session object
Thanks for the suggestions.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!