1. #51
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    23
    Vote Rating
    1
    ipavlic is on a distinguished road

      0  

    Default


    Quote Originally Posted by ralscha View Post
    The problem is that the names of the parameters on the client side have to match the method parameter names on the server side. In your code there is no parameter with the name action or myList

    Code:
    @RequestMapping(value = "/updateMyForm", method = RequestMethod.POST)
    public ExtDirectResponse updateBasicInfo(Locale locale,  HttpServletRequest request, @RequestParam("action")String action,  @RequestParam("myList") String myList) {
    }
    This should work and myList should contain the json string.

    The next thing you could try is not encoding the parameter on the client side:
    Code:
    params : {
            action : "update",
            myList: myValues
        }
    and then use a parameter like this:
    @RequestParam("myList") List<String> myList
    Not sure if that works.
    Perhaps I needed to include additional clarifications. I have a MyValueObject which looks approximately like this:
    Code:
    MyValueObject {
        private String parameterOne;
        private String parameterTwo;
        private List<MyOtherValueObject> myList;
        ... //getters, setters
    }
    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:
    parameterOne=valueOne&parameterTwo=valueTwo&myList=[{"otherParameter":"otherValue"}]
    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?

    Put differently, why are parameterOne and parameterTwo automatically recognized as members of MyValueObject, while myList is not.

  2. #52
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    96
    Vote Rating
    7
    ralscha will become famous soon enough

      0  

    Default


    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.

  3. #53
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    23
    Vote Rating
    1
    ipavlic is on a distinguished road

      0  

    Default


    I will try with the Spring community as you suggested. Thank you for your help and suggestions!

  4. #54
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    23
    Vote Rating
    1
    ipavlic is on a distinguished road

      0  

    Default


    I am sorry to be bothering you again. How could I POST JSON data with extdirectspring? Currently, the data is urlencoded.

  5. #55
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    96
    Vote Rating
    7
    ralscha will become famous soon enough

      0  

    Default


    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.

  6. #56
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    23
    Vote Rating
    1
    ipavlic is on a distinguished road

      0  

    Default


    Quote Originally Posted by ralscha View Post
    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.
    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:
    Code:
      var basicInfo = new Ext.form.FormPanel( {
        ...
        api: {
          ...
          submit: profile.updateBasicInfo
        }
      });
    And then suppose the submit is called on a form:

    Code:
       basicInfo.getForm().submit( {
         params: {
           foo: 'bar',
           uid: 34
         }
       });
    Then the submitted POST request will have a application/x-www-form-urlencoded content-type in the header and its body will be urlencoded.

    I would like it to be a JSON request (having an application/json content type in the header and jsonData in the request body).

  7. #57
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    96
    Vote Rating
    7
    ralscha will become famous soon enough

      0  

    Default


    Quote Originally Posted by ipavlic View Post
    I would like it to be a JSON request (having an application/json content type in the header and jsonData in the request body).
    This I don't know. I guess you have to change the extjs code for this.

  8. #58
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    16
    Vote Rating
    0
    gmui is on a distinguished road

      0  

    Default 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.

  9. #59
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    96
    Vote Rating
    7
    ralscha will become famous soon enough

      0  

    Default


    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>

  10. #60
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    16
    Vote Rating
    0
    gmui is on a distinguished road

      0  

    Default


    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

  1. Ext + Java + Spring + DWR
    By sfwalter in forum Community Discussion
    Replies: 59
    Last Post: 13 Dec 2010, 3:31 AM
  2. Ext JS 3.1 And Spring Webflow 2.0.8 Integration
    By erosszz in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 2 Feb 2010, 11:33 PM
  3. Ext.Direct width Spring??
    By jonathanlarav in forum Ext.Direct
    Replies: 0
    Last Post: 1 Jun 2009, 5:10 PM
  4. Ext GWT and Spring MVC
    By Ivan Polak in forum Community Discussion
    Replies: 4
    Last Post: 12 May 2009, 10:55 PM
  5. Spring with EXT
    By sshah in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 11 May 2008, 12:53 PM

Thread Participants: 13

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi