Dhtmlx working with java struts application

hello,
I have been trying this dhtmlx embedding with struts app and not even moving a single inch.
please plugin any java working app with form please.
thank u.

Hi,
to intergrate dhtmlxForm with struts application you should do the follow:

  1. configure 2 actions: one for initializing page with form, another for loading data:
<action name="form" class="org.apache.struts.demoapp_struts.action.FormAction" method="formInit">
	<result name="success">/form.jsp</result>
</action>
<action name="form_data" class="org.apache.struts.demoapp_struts.action.FormAction" method="formData">
	<result name="success">/form_data.jsp</result>
</action>
  1. create FormAction class in related package (org.apache.struts.demoapp_struts.action for my example):
package org.apache.struts.demoapp_struts.action;
// all required imports

public class FormAction extends ActionSupport {

	private static final long serialVersionUID = 1L;

	private MessageStore messageStore = new MessageStore();
	public MessageStore getMessageStore() {
		return messageStore;
	}

	public void setMessageStore(MessageStore messageStore) {
		this.messageStore = messageStore;
	}

	public String formInit throws Exception {
		return SUCCESS;
	}

	public String formData() throws Exception {
		messageStore.setData("{ \"id\":\"1\", \"item1\": \"value1\", \"item2\": \"value2\" }");
		return SUCCESS;
	}
}

And class messageStore to put form data from action into view:

package org.apache.struts.demoapp_struts.model;

public class MessageStore {
	private String data;
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
}

Now you should create two views: one for form initialization code and another for loading data.
form.jsp:

// including form js/css files must appear here
<script>
var myForm, formData;
function doOnLoad() {
	formData = [
		// form elements structure
	];
	myForm = new dhtmlXForm("myForm", formData);
	myForm.load("form_data", "json");
</script>
<div id="myForm" style="height:500px;"></div>

form_data:

<%@ taglib prefix="s" uri="/struts-tags" %>
<s:property escape="false" value="messageStore.data" />

Now you have to place form sources in your project and make sure that they are available on page.
After that form must be initialized and populated with data from server.