如何从gwt中的post方法获取参数
我有一个html页面,我正在使用post方法发送一些参数。 现在我想在gwt客户机上获取这些参数。 gwt中是否有任何方法可以在客户端上获取post参数。? 我使用以下代码如何从gwt中的post方法获取参数,gwt,Gwt,我有一个html页面,我正在使用post方法发送一些参数。 现在我想在gwt客户机上获取这些参数。 gwt中是否有任何方法可以在客户端上获取post参数。? 我使用以下代码 <html> <body> <form action="http://localhost:8080/popnnn/js.html" method="post"> <input type="text" id="foo" name="foo"> <input typ
<html>
<body>
<form action="http://localhost:8080/popnnn/js.html" method="post">
<input type="text" id="foo" name="foo">
<input type="submit" value="Send" name="submit" id="submit">
</form>
</body>
</html>
这对于get方法来说是完美的,但是对于post则不是
请帮助……执行以下步骤:
- 只需将文件
转换为js.html
js.jsp
- 从请求参数获取post参数李>
- 在JSP中的隐藏div中设置该值,并在JAVA中访问它
- 更改表单标签的action属性,如下所示:
在这里查找有关的示例代码<form action="http://localhost:8080/popnnn/js.jsp" method="post">
<form action="http://localhost:8080/popnnn/js.jsp" method="post">
<div id="fooParameter" style="visibility: hidden;"> <%=request.getParameter("foo") %> </div>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <div id="fooParameter" style="visibility: hidden;"> <c:out value="${param.foo}" /> </div>
String foo = RootPanel.get("fooParameter").getElement().getInnerHTML(); TextBox text=new TextBox(); text.setText(foo);