Is it possible to retrieve the form name from a Java HTTPServletRequest?

后端 未结 1 1629
予麋鹿
予麋鹿 2020-12-19 17:25

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 ret

1条回答
  •  没有蜡笔的小新
    2020-12-19 17:40

    HTML form name is NOT submitted as part of the request. If you need it (why?) you can submit it as hidden input instead:

    ...

    In your servlet:

    String htmlFormName = request.getParameterValue("htmlFormName");
    

    0 讨论(0)
提交回复
热议问题