0

This is my JSP Page using Struts2 I have one Description with Multiple Employee with each Employee Target Date asign I want to Save this Details in database using JDBC java Code Please tell me how I set the value in jsp and get in my ActionBean Class this is my JSP Code This Code is Dynamic You can Add more Employee and Also Delete More Employee and Add More Description I want to use the Only Object.

This is an image of jsp

<s:form action = "hello" method = "post" enctype = "multipart/form-data">
        <div class="MainClass">
            <div class="col-12 row">
                <div class="col-6 row">
                    <div class="col-md-12 mb-2 ">
                        <label for="accidentDesc">Description</label>
                        <textarea style=" height: auto; padding: 15px 15px 30px; border-radius: 3px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); background: -webkit-linear-gradient(#F9EFAF, #F7E98D)" class="form-control form-control-sm"  rows="4"  placeholder="Brief Description"  ></textarea>
                    </div> 
                </div>
                <div class="col-6 row M" >



                    <div class="form-row col-md-12 MainClass_SubClass_"><!--This count is used to maintaince employee div-->

                        <div class="col-md-6 mb-2">
                            <label for="accidentDesc">Employee Name/Code</label>

                            <input  class="form-control form-control-sm" id="MainClass__SubClass__empId" name="employee.empCode"/>

                        </div>
                        <div class="col-md-3 mb-2">
                            <label for="accidentDesc">Department</label>
                            <input type="text" class="form-control form-control-sm" >

                        </div>
                        <div class="col-md-3 mb-2">
                            <label for="accidentDate">Target</label>
                            <input  class="form-control form-control-sm" type="text" />
                        </div>
                    </div>
                       <div class="form-row col-md-12 MainClass_SubClass_"><!--This count is used to maintaince employee div-->

                        <div class="col-md-6 mb-2">
                            <label for="accidentDesc">Employee Name/Code</label>

                            <input  class="form-control form-control-sm" id="MainClass__SubClass__empId" name="employee.empCode" />

                        </div>
                        <div class="col-md-3 mb-2">
                            <label for="accidentDesc">Department</label>
                            <input type="text" class="form-control form-control-sm" >

                        </div>
                        <div class="col-md-3 mb-2">
                            <label for="accidentDate">Target</label>
                            <input  class="form-control form-control-sm" type="text" />
                        </div>
                    </div>

                </div>
            </div>

        </div>
        <button  class="btn btn-success" >Submit</button>
    </s:form>
2
  • It's not clear what the question is. Dec 18, 2018 at 13:38
  • My jsp page is Above as an Image Attachment and Code I just want to set value and get in my Action class. Like One Description as String in map Key and List of Employee as Value which is Send From jsp to Action.Action class Map Map<String,ArrayList<ModelClass>> myobject and action class methodpublic String actionpointcheck() {for (Map.Entry<String, ArrayList<ModelClass>> entry : mapvalue1.entrySet()) { String key = entry.getKey(); System.err.println("mapvalue..."+key); ArrayList<ModelClass> value = entry.getValue(); System.err.println(value); }}
    – Ziyad Beg
    Dec 23, 2018 at 11:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.