If you're using test server deployment then you don't need to pass in store ids at all - you would simply have a bank of ASR test servers and users would deploy to them then hit your front end JSPs in order to preview. This works because each test server ASR would only have a single store, therefore your Web Script can hard code the store id (since there's only ever one store in an ASR, regardless of whether it's a test or live server).
Obviously this is a pretty heavyweight solution (it requires at least as many test server ASRs as you have concurrent preview activity), and the forum thread I linked earlier describes an alternative approach that doesn't require test server deployment at all (and is hence a lot lighter weight). In summary, that model involves having both the Web Script and your front end web application (your JSP) parameterised to receive the store id. The store id itself is sent in from the "Eye of Sauron" (preview) button in the Alfresco UI (which is always displayed to the user in the context of a sandbox, and so always "knows" which store id to pass through).
Take another look at that other thread - it goes into a lot more detail about how this model works, as well as describing two different ways to get the "Eye of Sauron" to call your external web application directly (passing through the store id) rather than the virtualisation server.
Cheers,
Peter