Struts 7 issue while posting the data

Priyanka Vaddadi <[email protected]> Thu, 15 May 2025 19:50:02 +0000
Newsgroups gmane.comp.jakarta.struts.user
Message-ID <DS0PR09MB10610BC9A2619FE632F78C5EBA590A@DS0PR09MB10610.namprd09.prod.outlook.com>
Hi

We are migrating from struts 2.3 to struts 7.0.0

As part of this migration I am facing below issue

There is a action class  in my project  in which we defined SupplierSearchData variable as below
public final class CgSupplierMgmtSearchAction extends EmsWebAction implements ValidationAware {

    private SupplierSearchData supplierMgmtSearchData;

From UI  On click of submit button we are calling some java script function  in which we have below logic
var postData = "supplierMgmtSearchData.supplierName="+supplierName+
                                                                                          "&supplierMgmtSearchData.cityOfLicense="+cityOfLicense+
                                                                                          "&supplierMgmtSearchData.countyOfLicense="+countyOfLicense+
                                                                                          "&supplierMgmtSearchData.calendarYear="+calendarYear+
                                                                                          "&supplierMgmtSearchData.receivedDateFrom="+receivedDateFrom+
                                                                                          "&supplierMgmtSearchData.receivedDateTo="+receivedDateTo+
                                                                                          "&supplierMgmtSearchData.approvedDateFrom="+approvedDateFrom+
                                                                                          "&supplierMgmtSearchData.approvedDateTo="+approvedDateTo+
                                                                                          "&supplierMgmtSearchData.queueId="+queueId+
                                                                                          "&supplierMgmtSearchData.supplierFirstName="+supplierFirstName+
                                                                                          "&supplierMgmtSearchData.supplierLastName="+supplierLastName+
                                                                                          "&supplierMgmtSearchData.supplierDbaName="+supplierDbaName+
                                                                                          "&supplierMgmtSearchData.licenseNumber="+licenseNumber+
                                                                                          "&supplierMgmtSearchData.cityOfBusiness="+cityOfBusiness+
                                                                                          "&supplierMgmtSearchData.federalTaxId="+federalTaxId+
                                                                                          "&supplierMgmtSearchData.supplierId="+supplierId;

                              loadSupplierMgmtSearchResults("<s:url value="supplierMgmtSearch.action" encode="true"/>",postData);

The definition of function  loadSupplierMgmtSearchResults  is as below

function loadSupplierMgmtSearchResults(url, postData){
               alert(1);
               $('#rightSupplierMgmtContainer').html("<img src='../web/images/int/busy.gif'>");
               $.ajax({
                              type: "POST",
                              url: url,
                              data: postData,
                              cache: false,
                              async: false,
                              success: function(html){
                                             $("#rightSupplierMgmtContainer").html(html);
                              },
                              error: function(html, status, error) {
                                             alert("In loadSupplierMgmtSearchResults, Error:"+error);
                              }
               });
               return false;
}


But looks like what ever the data I am posting to action class is not getting mapped to SupplierSearchData in action class

SuplierSearchData class is as below

ublic class SupplierSearchData implements Serializable {


    /**
               *
                */
               private static final long serialVersionUID = 1L;
               private String supplierId;
    private String supplierName;
    private String cityOfLicense;
    private String countyOfLicense;
    private String queueId;
    private String calendarYear;



Please let me know what is the problem here. If it is parameters , I think we need to annotate with @StrutsParameter . but here the form data should be mapped to object in action class? Is there any annotation available to achieve this

Thanks

Priyanka






CONFIDENTIALITY NOTICE: This communication with its contents may contain confidential and/or legally privileged information. It is solely for the use of the intended recipient(s). Unauthorized interception, review, use or disclosure is prohibited and may violate applicable laws including the Electronic Communications Privacy Act. If you are not the intended recipient, please contact the sender and destroy all copies of the communication.