Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Array in query string

Posted on 2002-07-29
Medium Priority
Last Modified: 2008-03-17
hai friends,
is it possible to send array variables through
query string.if so,kindly give me the syntax.
(i.e)i am having an array in test1.jsp.without submit the
form i required these array values in next jsp (test2.jsp).i couldn't
use session in my program.i think only possible way is using
query string.but i don't know the syntax.help me if anybody know the answer.

Question by:Marysweety
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 33

Expert Comment

ID: 7185230
you could pass the array on the query string as seperate values ... but if you are going to do this, I would use POST instead of GET (query-string) because the query-string can only be used for a limited amount of data.  Show us your code ...
LVL 18

Accepted Solution

bobbit31 earned 100 total points
ID: 7185377
you could set a property in the servlet context, something like this:

in jsp1,
getServletContext().setAttribute("MyKey", arrVal);

in jsp2,
arrVal = (String[]) getServletContext().getAttribute("MyKey");

to remove it from the servlet context:
getServletContext().setAttribute("MyKey", null);

Expert Comment

ID: 7186979
>>i couldn't use session in my program
May I know why you can't use session?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 7187356
hai kotan,

i am just revamping the created project.they have already

used session and made many checking in more than 45 files.

so,if i use session i would be make some tiny corrections

in all that files.so only i tried to avoid session variables.

thx for yr reply.

Mary sweety.

Author Comment

ID: 7187361
hai bobbit31,
thanks a lot.Now I could easily pass array values using set properties of
the servletcontext,which is suggested by you. It is working fine.

LVL 18

Expert Comment

ID: 7188933
> thanks a lot.Now I could easily pass array values using set properties of
the servletcontext,which is suggested by you. It is working fine.

then why the 'B' grade?

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question