preface: I'm currently using struts2-core-2.3.1.2, and updating is not an option.
I am trying to implement the required HTML5 fields in my struts2 form. racks don't even display this:
<s:textfield name="x_serialNbr" id="i_sn" required />
and while it will look like this:
<s:textfield name="x_serialNbr" id="i_sn" required="true" />
<s:textfield name="x_serialNbr" id="i_sn" required="required" />
the resulting HTML is not what I want:
<input type="text" name="x_serialNbr" value="" id="i_sn" />
after extensive googling, this post is the closest one over a year ago , I can find something that concerns my problem. it seems this problem has been resolved in the current version of struts2, but, as I said, I can’t update.
as far as i can see my options
- dynamically add “required” attributes to the appropriate fields when the page loads.
- roll my own check
- ?? -, ? - , ?