我有一个ArrayList
数组ArrayList<[obj1,obj2]>
。这里obj1
和obj2
是不同的Java实体,这个列表由HQL查询返回。
如何遍历struts.xml
文件中的此列表以将其作为JSON结果发送?
我试过下面的组合,但没有运气:
^itemList\[\d+\]\.^\[\0+\].id
- &gt; id是实体的属性^itemList\[\d+\]\.\0\.id
^itemList\[\d+\]\.co.id
- &gt; co = hql中的实体别名^itemList\[\d+\]\[0].id
^itemList\[\d+\]\.\[\0+\].id
^itemList\[\d+\]\.[0].id
我在struts.xml
中使用了它,如下所示;
<action name="list-view-op-cost-management_cons" class="com.eves.aixis.s2.action.billing.ConsignmentBillingGridAction" method="listViewOperationalCostForManagement">
<result type="json">
<param name="ignoreHierarchy">false</param>
<param name="includeProperties">
viewType,
searchType,
searchValue,
service,
page,
total,
records,
**^itemList\[\d+\]\.^\[\0+\].id,**
reqaction_,
actionResult,
^errorList\[\d+\]
</param>
</result>
</action>
编辑:
Obj1 =寄售(商业实体)
with fileds;
private Integer id;
private String consignmentNo;
private Customer sender;
private Contact senderContact;
private Pickup pickupRef;
private Receiver receiver;
private List<Invoice> invoiceList;
private ConsignmentStatus consignmentStatus;
private Boolean invoiceToReiver;
private String deliveryInstruction;
private String customerReference;
private List<PackageDescription> packageDescription;// actual package info
private List<PackageDescription> custPackage;//use in ecp (external customer portal) and use in inquiry given customer package details
private List<PackageDescription> revProtPackages;//revenue protection packages
private Receiver deliveryAddress;
private List<ConsignmentTrack> connoteTrack;
private ProductType productType;
private List<Commodity> commodities;
private PreBriefDeskVerify briefDeskVerify;
和obj2 = SalesOrder(商业实体)
with fileds;
private Long id;
private SalesOrderType salesItemType;
private Consignment salesItem;
private MasterAirwayBill mawb;
private Pickup pickupSI;
private Delivery deliverySI;
private WHSalesItem whSalesItem;
private Job job;
private SCMBillingState billingState;
private Tariff tariff;
private Tariff tariffForPrinciples;
private List<SalesOrderLineItem> salesOrderItemList;
private String remarks;
private SalesOrderStatus salesOrderStatus;
答案 0 :(得分:0)
param <android.support.design.widget.FloatingActionButton
[...]
app:layout_behavior="your.package.name.FloatingActionButtonBehavior"/>
包含一个正则表列表,用于匹配serializable到JSON对象的属性。此正则表达式应与您的属性名称匹配,请尝试
includeProperties
如果您只想要^itemList.*$
属性,那么您可以尝试
id