-
31 Jan 2012 6:09 AM #51
Perhaps I needed to include additional clarifications. I have a MyValueObject which looks approximately like this:
When the form is submitted, the fields called parameterOne, parameterTwo are correctly packed in the request. myList is also added to the request as a parameter, and its value is a JSON encoded list (the POST request looks approximately like this from firebug):Code:MyValueObject { private String parameterOne; private String parameterTwo; private List<MyOtherValueObject> myList; ... //getters, setters }
On the server side, the fields are deserialized to a MyValueObject, and I can normally get its parameterOne and parameterTwo with getParameterOne() and getParameterTwo(). JSON-encoded MyList, is however not properly deserialized in a List<MyOtherValueObject> myList-- myList is null. Can I achieve proper deserialization, and how?Code:parameterOne=valueOne¶meterTwo=valueTwo&myList=[{"otherParameter":"otherValue"}]
Put differently, why are parameterOne and parameterTwo automatically recognized as members of MyValueObject, while myList is not.
-
31 Jan 2012 6:19 AM #52
Interesting. Form Post methods are handled by Spring. Looks like Spring is doing a lot of magic to find the parameters.
ExtDirectSpring is not doing a lot with form post request it only redirects them to Spring, so I'm not a lot of help here. Maybe the Spring Forum is a better place to ask this.
-
31 Jan 2012 6:33 AM #53
I will try with the Spring community as you suggested. Thank you for your help and suggestions!
-
1 Feb 2012 12:46 AM #54
I am sorry to be bothering you again. How could I POST JSON data with extdirectspring? Currently, the data is urlencoded.
-
1 Feb 2012 1:04 AM #55
I would try and map the json string to a String parameter on the server side. And then deserialze this String into an Object inside the method.
-
1 Feb 2012 1:16 AM #56
It seems to me that what you are saying is that once I already have the JSON data on the server side, I can do something with it.
What I would like to know is how to POST JSON data to the server side from a form.
Suppose the form is defined like in the wiki on your website, approximately:
And then suppose the submit is called on a form:Code:var basicInfo = new Ext.form.FormPanel( { ... api: { ... submit: profile.updateBasicInfo } });
Then the submitted POST request will have a application/x-www-form-urlencoded content-type in the header and its body will be urlencoded.Code:basicInfo.getForm().submit( { params: { foo: 'bar', uid: 34 } });
I would like it to be a JSON request (having an application/json content type in the header and jsonData in the request body).
-
1 Feb 2012 1:24 AM #57
-
26 Apr 2012 5:12 AM #58
Minimum requirements?
Minimum requirements?
I'm interested in using this Ext.Direct implementation and was wondering whether it will work with JDK6. I tried to download and run the demo using 'mvn tomcat7:run but I get a javac error ' invalid target release: 1.7.
But your work looks promising and I look forward to trying it out.
-
26 Apr 2012 8:23 AM #59
The demo should work with Java 1.6. Simply configure the maven-compiler-plugin with 1.6 in pom.xml
The library should even work on Java 1.5 but not the demo
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
-
26 Apr 2012 9:20 AM #60
Thanks - I got past that now by installing Java 7. Running mvn tomcat7:run now starts it up, but when I go to localhost:8080/ I get a 404 error. How can I tell that it built and is running appropriately? Should this in the end be the same demo site you have running at http://e4ds.rasc.ch/e4ds/login.html?
Similar Threads
-
Ext + Java + Spring + DWR
By sfwalter in forum Community DiscussionReplies: 59Last Post: 13 Dec 2010, 3:31 AM -
Ext JS 3.1 And Spring Webflow 2.0.8 Integration
By erosszz in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 2 Feb 2010, 11:33 PM -
Ext.Direct width Spring??
By jonathanlarav in forum Ext.DirectReplies: 0Last Post: 1 Jun 2009, 5:10 PM -
Ext GWT and Spring MVC
By Ivan Polak in forum Community DiscussionReplies: 4Last Post: 12 May 2009, 10:55 PM -
Spring with EXT
By sshah in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 11 May 2008, 12:53 PM



Reply With Quote