how can I sent value to JSP by javascript?
I want to sent latitude and longitude parameters to JSP

<button onclick="getLocation()">click</button>
function getLocation() {

if (navigator.geolocation)
alert("Oops, no geolocation support");

function displayLocation(position) {

var latitude = position.coords.latitude;       // ดึงเอาค่า lat
var longitude = position.coords.longitude;  // ดึงค่า long




I don't know what form i should do
thnk you very much!

You need a JSP script that will receive the data either via HTTP GET or POST.

Do you want to interact with this JSP page/script via postback or behind the scenes using AJAX?

You reference a link that covers not jsp.

In any case, I'd recommend you use javascript to pass the parameters using Ajax back to the JSP page. You can do this easily using the jQuery library.

You'd have to be comfortable with HTML and basic JavaScript to be able to incorporate jQuery in your page.

Or even better learn Wicket framework

You need AJAX request to sent to your backend