?
Solved

Array in query string

Posted on 2002-07-29
6
Medium Priority
?
538 Views
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.

regards,
Marysweety.
0
Comment
Question by:Marysweety
[X]
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
6 Comments
 
LVL 33

Expert Comment

by:knightEknight
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 ...
0
 
LVL 18

Accepted Solution

by:
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);
0
 
LVL 6

Expert Comment

by:kotan
ID: 7186979
>>i couldn't use session in my program
May I know why you can't use session?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Marysweety
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.

Regards,
Mary sweety.
0
 

Author Comment

by:Marysweety
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.

thanks&regards,
Marysweety.
0
 
LVL 18

Expert Comment

by:bobbit31
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?
0

Featured Post

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!

Question has a verified solution.

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

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

743 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