Eric's absolutely correct, but you can take it a step further. If you need it to be on the same page, as soon as the javascript field is populated, have the page post to the same page and then look for that passed value from the input via the appropriate request method.

No argument there. One should understand how it all works together. The best way that helped me understand how it all interacted was turning on both debugger in the javascript functions (if used) and running the processes in debug mode for the Java portion. That way you could see exactly what was being passed from the page to the Java code. Pretty cool to see how the information is extracted. Well, if you're me, it's pretty cool.

Anyway, if the questioner and whomever else is interested are smart, they'll read the article and play around so that they do understand what's going on. Otherwise, they'll be no better than many certified people I've had the displeasure of interviewing -- lots of knowledge (memorization) and no understanding or application.