I have a JSP with a Struts <html:hidden property="message">
field and I want to display it in the generated HTML to the enduser.
views:
231answers:
2You're not giving many details on what exactly you are trying to do but I am assuming that you have a field
<input type="hidden" ... />
which you would like to change to something like
<input type="text" ... />
If this is the case you can use JQuery to modify the type of the field, or even create a new field with the hidden field's value. Maybe this can help you http://stackoverflow.com/questions/1544317/jquery-change-type-of-input-field I might be able to help more if you give me some more details.
Edit: The Struts hidden tag gets rendered as an <input type="hidden"> element (you can browse the resulting html code to see that for yourself), so you can indeed use JQuery to display it. Assuming your hidden element's id is "hiddenElement" you can use
$("#hiddenElement").val()
in your javascript to get its value and display it wherever you wish. There are a lot of interesting things you can do with JQuery, so you can read the documentation to get a few more ideas on how to use it.
You can always change this (in Struts):
<html:hidden property="message">
To
<bean:write property="message" /> <!-- Creates the "message" as text -->
OR
<html:text property="message"> <!-- Creates a text box that with a populated message -->