A HREF= question within a servlet
Very basic question..
I have a servlet in which I am creating a webpage with links. The link however contains some data in the form of a variable.
ex:
body+="
<a href=\"http://domain.com/xxx?currentPage=somePage?id=SOMEVARIABLE\">link</a>"
How can SOMEVARIABLE be expressed as its value? I think I am getting confused with the quotes....
Thanks!
[406 byte] By [
pg917a] at [2007-10-3 2:25:02]

Thanks! One more thing..
This link points to a login servlet, where once the user logs in, it is redirected to the previous page. I thought the above structure would do that...as in "http://domain.com/xxx?currentPage=somepage?id=xxx"
Doesn't this tell the Login servlet that after logging in ,send the user to the current page?
I am using POST, but does that syntax only work with GET? Is there another way I should do that?
pg917a at 2007-7-14 19:24:03 >

Try avoiding URL rewriting in href as much as you can since URL parameters are visible to users.
Instead you could call some javascript function on click of ur link wherein you should submit ur form so as to POST it.
In this function you need to set your hidden parameters.
<script>
function myFunction();
{
document.forms[0].action"http://domain.com"; // or set the action in the form tag
document.forms[0].xxx.value="currentPage";
.......
document.forms[0].submit();
}
</script>
You may add out.println(..) tags for ur servlet