I would like to get the name of the form used to post parameters from a Java HTTPServletRequest object. Is this possible. I don't see any method that looks like it will return it to me.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
HTML form name is NOT submitted as part of the request. If you need it (why?) you can submit it as hidden input instead:
<form name="myForm" action="/my_servlet">
<input type="hidden" name="htmlFormName" value="myForm"/>
...
In your servlet:
String htmlFormName = request.getParameterValue("htmlFormName");