0

So I have two parameters I want to pass, one is a string and the other is an array named query and tags. The problem is that tags has multiple values (like an array). I tried

/?query=val&tags=val1+val2+val3

But since my val1,2,3 may have spaces in them, the encoding messes it up because space is encoded as '+'. Also can't use multiple variables since the length of the array is dynamic. How should I encode this?

EDIT: for the answers on the similar question, the array is split by &'s, however that is reserved for splitting the query into parameters. Is there a way of encoding this such that the parameter stays between two &'s?

Lor
  • 1
  • 3
  • possible duplicate of [How to pass an array within a query string?](http://stackoverflow.com/questions/6243051/how-to-pass-an-array-within-a-query-string) – Dexter Nov 05 '13 at 22:49
  • Did you try using   ? Also check this out: http://stackoverflow.com/questions/1763508/passing-arrays-as-url-parameter – Esqarrouth Nov 05 '13 at 23:10

1 Answers1

0

Ended up encoding with a semi-colon to separate the values instead. In my servlet I then parsed the string to an array accordingly

Lor
  • 1
  • 3