简体   繁体   中英

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. Does getParameter(nameOfLabel) work for this? 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:

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

And then use getParameter("labelName") to get its value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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