Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RPCManager.send can't send object

    HI, I wanted to send back object data to client. Here is my server side jsp file. Could anybody help me to understand how to send object (complex type data).

    <%@ page import="com.isomorphic.rpc.*" %>

    <%
    RPCManager rpc;
    class ClassUserDetail {
    String user_full_name;
    }

    ClassUserDetail userDetail = new ClassUserDetail();

    userDetail.user_full_name = "James, Bond";
    rpc.send(userDetail);

    %>


    #2
    Take a look at the docs for rpcRequest.data as well as the DMI overview.

    Comment


      #3
      For the sake of begginners like me, I have figured out how to and let me post here,
      (And anybody can suggest neater or simpler way, then really appreciate it.)

      Server-side JSP file.
      --------------------------------------------------------------------------------
      <%@ page import="com.isomorphic.rpc.*" %>
      <%@ page import="com.isomorphic.datasource.*" %>
      <%@ page import="com.isomorphic.util.*" %>
      <%@ page import="java.util.Map" %>
      <%@ page import="java.util.HashMap" %>

      <%
      RPCManager rpc;

      try {
      rpc = new RPCManager(request, response, out);
      } catch (ClientMustResubmitException cmre) {
      return;
      }

      //String user = request.getRemoteUser();
      String user = rpc.getUserId();
      DSRequest dsR = new DSRequest("s100_users", "fetch");
      dsR.setCriteria(DataTools.buildMap("user_id", user));
      DSResponse exe = dsR.execute();
      HashMap <String, String> map = new HashMap<String, String>();

      map.put("user_full_name", exe.getFieldValue("user_full_name").toString());
      map.put("user_id",exe.getFieldValue("user_id").toString());
      rpc.send(map);
      %>

      Comment

      Working...
      X