I don't think you can access javascript variables in JSP, as JSP is executed on server-side and all javascript modifications a done on client side.
In this case you need to post this input value to server using servlet or Ajax method and store it in a property file.
I'm in a situation where my index.jsp form should go to a servlet only when the input field is not empty otherwise it should just throw out an alert box.
The problem here is that it always goes to the servlet and doesn't care if the field is empty or not.
How to use the execution of alert box in the flow of the program.