[英]How to send a path from a HTML form to a servlet?
我想从HTML表单发送路径(它是属性文件的路径)到servlet。 servlet如何读取路径?应该在servlet中编写什么代码?
我认为您可以通过执行以下操作来解决此问题:
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp">
First name: <input type="text" name="fname"><br>
<input type="hidden" name="country" value="Norway">
<input type="submit" value="Submit">
</form>
<p>Notice that the hidden field above is not shown to a user.</p>
</body>
</html>
在您的servlet中,然后调用doPost方法和.getParameter(“ country”)上面的示例来自: http : //www.w3schools.com/tags/att_input_type.asp我希望这是解决您问题的方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.