Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:24:35+00:00 2026-06-10T05:24:35+00:00

I am trying to use extjs store to talk to a Jersey rest Java

  • 0

I am trying to use extjs store to talk to a Jersey rest Java application (running at tomcat) that returns a Json.
And I am trying to use Json to print to a grid component.
This is my store code.

Ext.define('WSC.store.Users', {
extend: 'Ext.data.Store',
fields: ['period','tot_units', 'tot_selling_price'],
model: 'WSC.model.User',
proxy: {
    type: 'rest',
    url : 'http://localhost:8080/mondrianCube/services/query/querygoeshere/json',
    reader: {
        type: 'json',
        root: 'table'
    }
},
autoLoad: true

});

The store was not able to read the json obtained. Most of the recommendations were to add response headers(Access-Control-Allow-Origin) to the webapp(running at tomcat).
So I added the response headers like below.

@Path("/query/{qryParam}/json")
@GET
@Produces(MediaType.APPLICATION_JSON)
public static Response jsonResult(@PathParam("qryParam") String qryParam) throws JSONException 
{
    executeQuery("select {[Measures].members} on columns, {Time.[2010], Time.[2010]} on rows from sales" );
    String json = (new JSONObject(((new ResultSetConvert(result)).toJson()))).toString();
    return Response.ok(json).header("Access-Control-Allow-Origin","*").build();     
}

Even then I get the same error as below

https://i.stack.imgur.com/X2cKd.png

What am I missing here?

P.S If the url points to a file in the same domain, the store is able to read the json in the file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:24:36+00:00Added an answer on June 10, 2026 at 5:24 am

    I believe you’ll want to use JSONP for this, for example,

                Ext.get('search-form').on('submit', function(ev) {
                    ev.preventDefault();
                    Ext.ux.JSONP.request('http://api.flickr.com/services/feeds/photos_public.gne', {
                        callbackKey: 'jsoncallback',
                        params: {
                            format: 'json',
                            tags: Ext.fly('search-value').dom.value,
                            tagmode: 'all',
                            lang: 'en-us'                            
                        },
                        callback: updateResults
                    });
                    return false;
                });
    

    jsonp by wikipedia definition

    JSONP or “JSON with padding” is a complement to the base JSON data format. It provides a method to request data from a server in a different domain, something prohibited by typical web browsers because of the same origin policy.

    Same origin policy by definition

    In computing, the same origin policy is an important security concept for a number of browser-side programming languages, such as JavaScript. The policy permits scripts running on pages originating from the same site to access each other’s methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites.[

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to use direct store in Extjs heres the code to my store
I am trying use gem tire to search in my application. I have tables
I am trying use a Java Uploader in a ROR app (for its ease
I am trying to use Ext.Ajax.request in ExtJS 4.02a but it will not run
I am trying to integrate ExtJS 2.0 with Java rich faces. I am trying
I am trying to use ExtJS with Asp.Net MVC, and it is going fine
Based on my previous thread I'm trying to use ExtJS to call a function
I'm trying to set up an Extensible Calendar Pro in my ExtJs 4.1 application,
Newbie question here. I am trying to use the django-extjs library in my django
I'm trying to create a web application using a JavaScript framework (eg Extjs) for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.