简体   繁体   English

使用Java从Servlet获取标签的值

[英]Get the value of a label from a servlet using java

I would like to know how can I get the value of a label from the request servlet in Java. 我想知道如何从Java的请求servlet中获取标签的值。 Does getParameter(nameOfLabel) work for this? getParameter(nameOfLabel)是否getParameter(nameOfLabel)工作? Or does it only work for inputs?. 还是仅适用于输入? Anyhow, I'd like to know how to do so. 无论如何,我想知道如何去做。

You can create a hidden input with the value of the label: 您可以使用标签的value创建隐藏的input

<input type="hidden" value="labelValue" name="labelName" />

And then use getParameter("labelName") to get its value. 然后使用getParameter("labelName")获取其值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM