[英]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.