是否可以在dwr中使用treeset?

时间:2012-11-08 16:47:40

标签: java dwr treeset

我的问题是,我尝试使用DWR将TreeSet放入我的Javascript中。这是我的示例代码:

Javacode:

public class myDWRObject {
  public HashMap<String, Object> getData() {
    TreeSet<aComplexObject> myTreeSet = aFunctionThatReturnsThisTreeSet();
    HashMap<String, Object> myHashMap = new HashMap<String, Object>();
    myHashMap.put("MYID", myTreeSet);
    return myHashMap
  }
}

控制器servlet.xml中:

<beans>
  <bean id="myobject" class="de.apackage.myDWRObject " scope="request">
    <dwr:remote javascript="myObject">
      <dwr:include method="getData" />
      <dwr:filter class="de.apackage.DwrControllerInitializer"/>
    </dwr:remote>
    <aop:scoped-proxy proxy-target-class="false" />
  </bean>
  <dwr:configurations>
    <dwr:create javascript="myObject" type="spring" >
      <dwr:param name="beanName" value="myobject" />
    </dwr:create>
    <dwr:convert type="object" class="java.util.TreeSet" />
    <dwr:convert type="object" class="de.apackage.aComplexObject" />
  </dwr:configurations>
</beans>

model.xml:

<!-- {{{ CONTROLLER: myObject-->
  <controller name="myObject">

    <!-- {{{ METHOD: getData-->
    <method name="getData" type="GET|POST" session="require" transaction="false">
      <param_validator_ref idref="configspecdata"/>
      <param_validator_ref idref="ticketdata"/>

      <state value="ANY">
        <execute/>
      </state>

    </method>
    <!-- }}} -->
  </controller>
  <!-- }}} -->

在我的Html文档中:

<script type="text/javascript">
  function getData () {
    myObject.getData(callBack);
  }
  function callBack(aData){
    alert("done");
  }
</script>

现在是我的问题,我从apache服务器获得响应:

16:50:37,17  - WARN  - [main] org.springframework.beans.factory.support.DisposableBeanAdapter - Invocation of destroy method failed on bean with name 'dwrController': java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread) 

我不明白我的错,你能帮助我吗?是否有可能,dwr无法使用树集?

问候 曼尼

0 个答案:

没有答案