It will depend on how your Java Servlet expects to get it's variable(s), GET or POST.

If GET (query string) is OK, then it's easy, just add the info to the end of the URL, eg:
code:

var strName = "Tim";
var strURL = "/java/GetDetails.java";
var xmlDoc = new XML();
xmlDoc.ignoreWhite = true;
xmlDoc.onload = myOnLoadHandler;
xmlDoc.load( strURL + "?name=" + strName );


If it is expecting a POST then it might be a bit harder, I'm not sure how you could do that, Dowapdalilly's suggestion might work.

Hope this helps!