This is a problem that has been annoying me for a long time. First of all, I am not very experienced in Java, but I know Actionscript pretty well. Anyway, my problem is this: How can I get a variable (more specifically, a string) from Flash to a Java server?

Note, I am trying to get these variables to an actual .java file on a server, not a servlet like .jsp or .php (although if that is the best solution, I could try that too).

On the Flash side, I have this:

var sndLV:LoadVars = new LoadVars(); 		//variable for sending data
var rcvLV:LoadVars = new LoadVars(); 		//variable for recieving data

//execute when user presses submit button
submit_button.onPress = function():Void 
		sndLV.myVar= "Hello"; 												// data to be sent
// sending the variables and writing response to rcvLV 
sndLV.sendAndLoad("", rcvLV, "POST"); 
					{         // response success        
						status.text = "Connection successful!";
					{         // could not contact server      
						status.text = "Connection failed.";       
submit_button.addEventListener("click", submitListener);
On the java side, I have this:

public class flash2java extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

PrintWriter out = response.getWriter();

String myVar = request.getParameter("myVar");
As you can see, this is just a very simple program that is supposed to pass "Hello" from Flash to on the server. However, the only thing I get on the screen is a null because the java is not recieving anything from the Flash.

The problem that I think is happening is that the java file is only requesting the variable once. If I can get the java file to "poll" for the variable and only display it (or anything else I need to do with it) when it actually recieves it from the Flash, then that would be great.

Any ideas? Thanks!