4

I would like to know how to pass multiple parameters on the same link.

I would like to pass the parameter 4 also on the link window.open("http://www.av.com"+parm5,") how do i write it.

Detail Expl.

I would like to pass value in the value prompts such as the output should look like (para4=12/23/2013 & para5= 12/29/2013)

//MicroStrategy/servlet/mstrWeb?Server=gm0&Project=gmai+Production+Enterprise&Port=0&evt=2048001&src=mstrWeb.2048001&documentID=75DBCE17448CC18BB73B808303FC01A8&currentViewMedia=2&visMode=0&valuePromptAnswers=12/23/2013^12/29/2013

4
  • ?firstparam=test1&secondparam=test2 Commented Dec 27, 2013 at 13:56
  • Be some more specific ! Commented Dec 27, 2013 at 13:56
  • 1
    What does "parameters" mean? Are you asking how to concatenate more than one string? Are you asking how URLs work? What a querystring is? Commented Dec 27, 2013 at 13:56
  • Do you want to pass multiple parameters in a GET request? I think the answers in this question might help you. Commented Dec 27, 2013 at 13:58

2 Answers 2

5

Are you talking about query strings ie trying to get to a url with multiple parameters?

http://en.wikipedia.org/wiki/Query_string

cause it might look like something like this

"http://www.website.com?field1=value1&field2=value2&field3=value3"

if you are using a language to make this it just a matter of manipulating string variables.

Sign up to request clarification or add additional context in comments.

4 Comments

gmail/MicroStrategy/servlet/… I would also like to pass another value in the value prompts such as the output should look like gmail/MicroStrategy/servlet/…^12/29/2013
when passing values it always follows the same pattern. In this case it would be gmail/MicroStrategy/servlet/?date='12/29/2013'&user='user3101523'. it would be the controller that handles the request that determines how many parameters it can handle.
Hi, I am new to JSP, but what I am trying to say is I want to pass &valuePromptAnswers=12/23/2013^12/29/2013 in the same and not date='12/29/2013'&user='user3101523'
Ah sorry hard to understand if i am reading this correctly you want to pass multiple answers in one parameter in the url. I think maybe the best way to do that is to maybe serialize it in a JSON object. that way it becomes one large string and can allow it be Deserialized on the controller end. A serialized json object is just one large string and therefore would do the trick of allowing you to mass multiple items as one parameter.
1

Shouldn't it be something like ("http://www.av.com?param4="+param4+"&param5="+param5) ??

This is assuming you are already sanitizing the param values.

Edit 1: This is in response to your comments on the other answer.

It doesn't really matter whether you pass ....?oldDate='12/23/2013'&newDate='12/29/2013' or you just want to send both the dates in one single variable. Unless you can't send '^' in the URL, you can always send your data as ...?myDates='12/23/2013^12/29/2013'.

All you would need to do in the second case is to retrieve the value from myDates, and split it around '^'. If '^' is not allowed in the URL, you will have to look for a suitable alternate. I would suggest '_'. Then again, it doesn't really matter how you pass it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.