Announcement

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

    DataSource Spring DMI

    Hi,
    I have a question about Spring DMI. I am trying to pass additional parameters from the client to the spring bean method set to handle my fetch operations.
    I do the following on the client:
    Code:
        DataSource ds = DataSource.get("dataSourceId");
        Map m = new HashMap();
    				
        m.put("session_key", "session_value");
        ds.setDefaultParams(m);
    
        ListGrid lg = new ListGrid();
        lg.setDataSource(ds);
        lg.setAutoFetchData(true);
    dataSourceId.ds.xml is configured like the spring-hibernate-dmi sample
    with serverType "generic" and lookupType "spring"
    On the server the method that handles the fetch has the following signature
    Code:
    DSResponse fetch(DSRequest dsRequest)
    The fetch method gets called with a populated dsRequest
    I am trying to examine this object to find how to retrieve the properties I added on the client.
    Is this correct use of the defaultParams method?
    Is there some other way to pass custom parameters to the server preferably with this architecture?

    #2
    That's fine, but they are going to be HTTP Parameters, available via the servlets standard API httpServletRequest.getParameter().

    Note that HttpServletRequest is one of the objects you can declare as a parameter to a DMI and have it automatically provided.

    Comment


      #3
      Perhaps my configuration was not understood. I have taken the spring-hibernate-dmi sample and maybe changes to show what I want to accomplish.

      HibernateSpringDMI.java after DataSource retrieved then a Map is created to store a parameter, then the DataSource default parameters are set to the map.

      SupplyItemDao.java - I enumerate and print request parameter names and values. The key I added is not there.
      Attached Files

      Comment

      Working...
      X