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 5934275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:05:29+00:00 2026-05-22T15:05:29+00:00

In my app I use JsArray extensively to store my overlay types. I use

  • 0

In my app I use JsArray extensively to store my overlay types. I use java.util.List to store my client-side Java POJOs.

For performance reasons and to unify the way I access my model I planned to eliminate the Lists and use only JSO wrappers. Given a wrapper around a native array that can store any Java Object:

 public class JsArrayObject<T> extends JavaScriptObject {

        protected JsArrayObject() {}

        public final native T get(int index) /*-{
            return this[index];
        }-*/;

        public final native void push(T value) /*-{
            this[this.length] = value;
        }-*/;
    }

Is it safe to store Java Objects this way? The doc says that when you pass a Java Object into JavaScript the result is “an opaque value accessible through special syntax”. This sounds confussing to me. For instance if I push an Integer and try to get it an exception will be thrown because something different than an Object was found (at least in dev mode). The same happens with the rest of Java primitive Wrappers. Apart from the problems with Java primitive Wrappers, are there other concerns to be aware?

Many thanks

  • 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-05-22T15:05:30+00:00Added an answer on May 22, 2026 at 3:05 pm

    Which doc are you referring to? The one on this page?

    They’re talking in terms of passing Java objects into JavaScript with the intent of having JavaScript code use the methods or fields in the object. It is possible to do that, but the syntax you have to use on the JavaScript side is a bit awkward. If you’ve done any JSNI, you’ve seen it.

    If you don’t intend to access the Java objects from the JavaScript side you can ignore the business about the special syntax. So yes, it is safe. I’d be interested to know if it actually turns out to help performance.

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

Sidebar

Related Questions

in my app i use list view. in the list view i have three
You can use App.config; but it only supports key/value pairs. You can use .Net
In my rails app I use the validation helpers in my active record objects
In our web-app we use PHP5.2.6 + PDO to connect to a SQL Server
In my web app I use several asmx (Web Services) from the same provider,
Within an n-tier app that makes use of a WCF service to interact with
In a Rails app sometimes you use a redirect in an action... redirect_to :controller
I have written a Django app that makes use of Python threading to create
I am building a simple Django app that will use scribd to display documents.
All the examples that I can search online use the App.Config mode of specifying

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.