Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    23
    Vote Rating
    0
    andvitiello is an unknown quantity at this point

      0  

    Default Overcome the problem of the CORS (Access-Control-Allow-Origin) in MVC application

    Overcome the problem of the CORS (Access-Control-Allow-Origin) in MVC application


    I have built a web application using sencha touch 2. And therefore creating the whole infrastructure MVC. The client asks for the services to the server, that answers through json...in localhost everything is all right, but if I want to insert the server in a place and from the client to call the web application, the pages web is not released because the error Access-Control-Allow-Origin springs. How to overcome him/it, since my web application is a mvc?

    here the source code that there is a request to client from server:

    Code:
    Ext.define('Twitter.store.Contacts', {
    	extend: 'Ext.data.Store',
    
    
        config: {
            model: 'Twitter.model.Contact',
            autoLoad: true,
            
            pageSize: 100,
            clearOnPageLoad: false,  
        
            proxy: {
                type: 'ajax',
                url: 'http://server.render:9090/MVisualCRendServer/viewCommonClient.do'
            },
            reader: {
                     type: 'json',
                     successProperty: 'success',
                     root: 'tweet',
            }
        }
    });
    I cannot change this application through the proxy jsonp because I don't have a callback to send. The answer of the server is through a normal json.

  2. #2
    Sencha User
    Join Date
    Jun 2010
    Posts
    139
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default


    if JSONP is not an options, it cannot be done. You could of course write a backend yourself which is in the same domain as your client app. Let this backend make the call to the json-server which passes the response through to your client app! Or compile it to native!

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    23
    Vote Rating
    0
    andvitiello is an unknown quantity at this point

      0  

    Default


    I have not understood a lot sincerely. But of certain I cannot create a something, that I know a file, from the client that it calls in turn a service on the server. Then with json and therefore with ajax it is not possible to resolve this problem of the cross origin? Possible this thing? to me it seems strange. If I wanted to use jsonp as should I do?

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    118
    Vote Rating
    5
    subimage is on a distinguished road

      0  

    Default


    If you're hosting on apache you can do this pretty simply with a rewrite rule.

    Here's an example of mine in development.


    Code:
    <VirtualHost *:80>
      ServerName touch.cashboard.i
      ServerAlias touch.*
      DocumentRoot "/Users/seth/Work/cb_mobile/app/trunk"
      RewriteEngine On
      RewriteRule ^/api_proxy/(.*)$ http://api.cashboard.i/$1 [P]
    </VirtualHost>
    So I just make all my requests prefixed with '/api_proxy/' and it redirects it to my actual API which is another host. [P] means PROXY, which assumes you of course have mod_proxy installed for Apache.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    23
    Vote Rating
    0
    andvitiello is an unknown quantity at this point

      0  

    Default


    for my part server I use Apache tomcat 7.0.26. This line of code that you have written me, where should I insert it? I don't succeed in finding any files on where to insert this code

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    23
    Vote Rating
    0
    andvitiello is an unknown quantity at this point

      0  

    Default


    I have tried to use the proxy jsonp (also not inserting any function callback because I think that for my in demand services to the server it is not us of it need), but the error is visualized:

    resource interpreted as script but transferred with mime type text / html

    and any nestedlist is not visualized in the part client

Thread Participants: 2