• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

arrays

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 250
Python Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic