just flow Server Examples - Validations - DMI Validation
<code>
DSRequest dsRequest = new DSRequest("StockItem", "fetch");
Object itemId = record.get("itemId");
// if no item was selected, no way to run this validation - rely on a required
// validator on the itemId question to tell the user to populate the form.
if (itemId == null) return true;
dsRequest.setCriteria(DataTools.buildMap("id", record.get("itemId")));
Map dataMap = dsRequest.execute().getDataMap();
</code>
Map dataMap = dsRequest.execute().getDataMap(); throws exception :
2011-10-03 18:42:03,153 [l0-7] WARN com.isomorphic.util.DefaultValidators - Validator DMI invocation threw exception: java.lang.Exception: RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call.
at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:225)
at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:70)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:416)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1440)
<code>
DSRequest dsRequest = new DSRequest("StockItem", "fetch");
Object itemId = record.get("itemId");
// if no item was selected, no way to run this validation - rely on a required
// validator on the itemId question to tell the user to populate the form.
if (itemId == null) return true;
dsRequest.setCriteria(DataTools.buildMap("id", record.get("itemId")));
Map dataMap = dsRequest.execute().getDataMap();
</code>
Map dataMap = dsRequest.execute().getDataMap(); throws exception :
2011-10-03 18:42:03,153 [l0-7] WARN com.isomorphic.util.DefaultValidators - Validator DMI invocation threw exception: java.lang.Exception: RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call.
at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:225)
at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:70)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:416)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1440)
Comment