如何将javascript变量从index.html传递给index.jsp?

时间:2017-09-24 08:29:26

标签: html jsp url-rewriting parameter-passing

我可以在javascript和ajax中使用api获取客户国家/地区。

但现在我想将值发送到index。 jsp

如何重写网址或使用 index.jsp发送?country = someinfo

是否有任何方法通过url发送参数并在index.jsp中获取该变量值?

指数。 jsp 会与索引发生冲突。 html ???

1 个答案:

答案 0 :(得分:0)

index.jsp 不会与index.html发生冲突,它们是不同的文件。

您可以在描述index.jsp?country=someinfo

时按网址发送参数

但您也可以使用<form action = "index.jsp" method = "GET">发送,在表单中,每个输入<input name="country" value="someinfo"/>也会发送参数,请参阅more details

相关问题