How do I access nested POST data in the Java Servlet API? In PHP (which I can't use for this project), I was able to access fields with $ds = $_POST['details']['double_sided'];
I have the following inputs in my form:
<div class="row">
<div class="col-sm-6">
<label for="details_double_sided" class="control-label">
<input type="hidden" value="0" name="<portlet:namespace />details[double_sided]">
<input type="checkbox" id="details_double_sided" value="1" name="<portlet:namespace />details[double_sided]"> Double Sided
</label>
<label for="details_stapled" class="control-label">
<input type="hidden" value="0" name="<portlet:namespace />details[stapled]">
<input type="checkbox" id="details_stapled" value="1" name="<portlet:namespace />details[stapled]"> Stapled
</label>
<label for="details_three_hole_punched" class="control-label">
<input type="hidden" value="0" name="<portlet:namespace />details[three_hole_punched]">
<input type="checkbox" id="details_three_hole_punched" value="1" name="<portlet:namespace />details[three_hole_punched]"> Three Hole Punched
</label>
</div>
<div class="col-sm-6">
<label for="details_copied_in_color" class="control-label">
<input type="hidden" value="0" name="<portlet:namespace />details[copied_in_color]">
<input type="checkbox" id="details_copied_in_color" value="1" name="<portlet:namespace />details[copied_in_color]"> Copied in Color
</label>
<label for="details_copied_on_color_page" class="control-label">
<input type="hidden" value="0" name="<portlet:namespace />details[copied_on_color_page]">
<input type="checkbox" id="details_copied_on_color_page" value="1" name="<portlet:namespace />details[copied_on_color_page]"> Copied on Color Paper (Please indicate paper color in special instructions)
</label>
</div>
</div>
I've tried multiple methods, such as
String[] details = ParamUtil.get(request, "details[double_sided]", "0")
Object details = request.getAttribute("details");
String[] details = ParamUtil.getParameterValues(request, "details[]");
But they all seem to return null / empty values.