Solved

Array in query string

Posted on 2002-07-29
6
535 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 25 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
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

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Help with LDAp login using jsp 6 120
reflection example 3 131
getting param value 7 61
collection output issue 9 89
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Changing a few Outlook Options can help keep you organized!
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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