Java request query string

jlbryant
10-25-2006, 02:23 PM
I know how to request infor from the prevouse page form in .asp, so how would i do it in java? I usually do this <%response.write request("test")%> in .asp

Nayru
10-25-2006, 02:35 PM
A quick google search returns this as the first result:

http://www.activsoftware.com/code_samples/code.cfm/CodeID/59/JavaScript/Get_Query_String_variables_in_JavaScript


<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
alert('Query Variable ' + variable + ' not found');
}
</script>

Now make a request to page.html?x=Hello

<script>
alert( getQueryVariable("x") );
</script>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum