- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Browser Inter-Tab communication via Java Apple...
Operating System - OpenVMS
1748209
Members
2711
Online
108759
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2009 05:06 AM
тАО03-16-2009 05:06 AM
Hi Bojan,
Great to see you're still around!
It'll take me a bit longer to digest your answer to my other questions before I reply, but the funny thing is I mentioned your name just today over in comp.lang.java.programmer and I'd be interested in any feed back you may have on the feasibility of the strategy below.
(I'm also really interested in the best LinkedBlockingQueue type of class to manage the list of JSObject.getWindow() objects, but more on that later.)
Cheers Richard Maher
The following is from: -
http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/06e807a645ea8e78#
Hi,
For some time (ever since a guy called Bojan Nemec told me about it :-) I've been toying with the idea of my Java Applet declaring its TCP/IP Socket as a static class-variable instead of an instance-variable, and on each invocation (new page, new tab, or new browser) the init() would check to see if the Socket was already connected (and in my case User Authorization completed) and, if so, skip that bit. Where I think it would be useful is when there is a Control-Panel/Dashboard requirement, similar to what Arne and another poster were discussing recently, where each browser "tab" was a different set of instrumentation/view. All pages being servered by a single, secure, feature-rich, connection-oriented, context-laden, and high-performance Socket.
NB: If this is simply *just not doable* then please let me know now before I spend a few days trying to get it to work :-)
Some issues that spring to mind (that I hope someone can offer advice on) are: -
1) To continue my "single reader-thread to oodles of writer-threads" model, I'm really hoping that JSObject.getWindow() will return something that is both unique to each web-page instance (wherever it is hosted) and the accessible from my single reader thread. I plan to store it in a Linked-List along with a Unique Id that will accompany the user request-messages on their trips to the server and when they comes back, I'll search the list for matching index-number, get the corresponding JSObject, and then perform the .call(). (Perhaps JSObject is serializable? No wait - there's a toString() method! What's the reverse? I'm guessing you can't simply cast the String as JSObject.)
2) I hope that JSObject.getWindow() returns the same thing in the Applet's destroy() method as it does in the int() method so that I can do a reverse lookup. Hey, there's a JSObject.equals() method - You bewdy!
3) The whole concept of Socket-Hijacking a la mode de Session-Hijacking, I'm gonna leave to one side for the moment. I'm relying on Java to prohibit the manual construction/fudge of a Java Socket on top of just any old socket, and the operating system to protect a socket in one process/image from access by another unprivileged process/image.
4) How do I prevent just any old page from including an
Great to see you're still around!
It'll take me a bit longer to digest your answer to my other questions before I reply, but the funny thing is I mentioned your name just today over in comp.lang.java.programmer and I'd be interested in any feed back you may have on the feasibility of the strategy below.
(I'm also really interested in the best LinkedBlockingQueue type of class to manage the list of JSObject.getWindow() objects, but more on that later.)
Cheers Richard Maher
The following is from: -
http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/06e807a645ea8e78#
Hi,
For some time (ever since a guy called Bojan Nemec told me about it :-) I've been toying with the idea of my Java Applet declaring its TCP/IP Socket as a static class-variable instead of an instance-variable, and on each invocation (new page, new tab, or new browser) the init() would check to see if the Socket was already connected (and in my case User Authorization completed) and, if so, skip that bit. Where I think it would be useful is when there is a Control-Panel/Dashboard requirement, similar to what Arne and another poster were discussing recently, where each browser "tab" was a different set of instrumentation/view. All pages being servered by a single, secure, feature-rich, connection-oriented, context-laden, and high-performance Socket.
NB: If this is simply *just not doable* then please let me know now before I spend a few days trying to get it to work :-)
Some issues that spring to mind (that I hope someone can offer advice on) are: -
1) To continue my "single reader-thread to oodles of writer-threads" model, I'm really hoping that JSObject.getWindow() will return something that is both unique to each web-page instance (wherever it is hosted) and the accessible from my single reader thread. I plan to store it in a Linked-List along with a Unique Id that will accompany the user request-messages on their trips to the server and when they comes back, I'll search the list for matching index-number, get the corresponding JSObject, and then perform the .call(). (Perhaps JSObject is serializable? No wait - there's a toString() method! What's the reverse? I'm guessing you can't simply cast the String as JSObject.)
2) I hope that JSObject.getWindow() returns the same thing in the Applet's destroy() method as it does in the int() method so that I can do a reverse lookup. Hey, there's a JSObject.equals() method - You bewdy!
3) The whole concept of Socket-Hijacking a la mode de Session-Hijacking, I'm gonna leave to one side for the moment. I'm relying on Java to prohibit the manual construction/fudge of a Java Socket on top of just any old socket, and the operating system to protect a socket in one process/image from access by another unprivileged process/image.
4) How do I prevent just any old page from including an
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2009 03:27 AM
тАО03-18-2009 03:27 AM
Solution
Richard,
1) There is a wide used method for JavaScript serialization/deserialization it is named JSON (JavaScript Object Notation). There is the link:
http://www.json.org/
http://www.json.org/js.html
The second is for JavaScript.
Or just google to find more.
The JavaScript object is serialized in a string. So you can serialize in one window (one JSObject) and deserialize in another window. And more, you can serialize/deserialize betwen two different systems.
2) You give the ansawer. It should return the same object every time you call it (in the same window).
3)
4) I will first test if the browser create two different Applets if they are loaded from different Document bases. You should look to the static components of the applet.
5) Without this you get in troubles. You should also stop the reader thread.
6) You mean the same Virtual Machine (running process) or the same software distribution?
Bojan
1) There is a wide used method for JavaScript serialization/deserialization it is named JSON (JavaScript Object Notation). There is the link:
http://www.json.org/
http://www.json.org/js.html
The second is for JavaScript.
Or just google to find more.
The JavaScript object is serialized in a string. So you can serialize in one window (one JSObject) and deserialize in another window. And more, you can serialize/deserialize betwen two different systems.
2) You give the ansawer. It should return the same object every time you call it (in the same window).
3)
4) I will first test if the browser create two different Applets if they are loaded from different Document bases. You should look to the static components of the applet.
5) Without this you get in troubles. You should also stop the reader thread.
6) You mean the same Virtual Machine (running process) or the same software distribution?
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 05:48 PM
тАО03-19-2009 05:48 PM
Re: Browser Inter-Tab communication via Java Applet
Hi Bojan,
1) I was aware of JSON; at least in so far as the Yahoo! APIs, their "callbacks", and eval()ing JSON. I wasn't aware of the stringify() and parse() functions, but I'm not keen on lugging around 17KB of JavaScript just to do that. But I guess we should be discussing the Java side and whether JSObject "implements serializable" and how to get the output into a string instead of a file/socket and. . . and it all gets too hard. Anyway, with your lovely LinkedList/Queue for messages *sent*, I can just check the sequenceNum of the MessageObject at the head of the queue against the incoming message. If there's a mismatch I can log everything out. Otherwise, when the JavaScript Callback calls "done", I'll pop the JSObject off the queue, return, and let it get re-used or GC'ed. I like it!
2) Good news!
3/4) Phew - you had me worried there! My observations are that: -
i) The same Applet (and same codebase) referenced from Document Bases where the server portion is different will yield "different Applets".
ii) Different html pages on the same server referencing the same Applet (and same codebase) still yeilds the same Applet class and an overlay of the static class variables.
I will ask about suggestions for the best OO implementation later, but for the sake of background one of the requirements is this: - One FF browser instance with 4 tabs. The first 3 tabs will be part of the same Tier3Application (eg: PowerStation) the last tab will be a separate application (eg: TimeSheet). When the first of either of the PowerStation tabs is opened, my Applet will create the Socket, connect to the Server, and prompt for Username/Password. The next two pages will see (via the approriate static class variables) that the connection's up and not need to reauthorize. The 4th tab will have the same Applet but the different APP_NAME, PORT, and/or CodeBase, will be forced to a separate network connection and the Username/Password exchange.
Now, in order to prevent a malicious page from just including a an
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2009 09:31 AM
тАО03-20-2009 09:31 AM
Re: Browser Inter-Tab communication via Java Applet
1) I think that it will be very dificult (or inposible) to do the serialisation on the Java side. Probably you have to write something like JSON in Java. If you look at the source of the JSObject (see links in http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1323184 ) Java knows nothing about the JavaScript object it knows only its internal number. Why not use JSON? Your Java code for serializing/deserializing will also eat some KB. And an image on your web page will eat much more. JavaScript is cached on the browser side so the download will be only once a time. On the other hand You probably can not simply transfer the JSObject from one window to another (or maybe you can? To be tested).
4)
i) That is OK.
ii) Still OK.
If the two applications have the same Applet & codebase you should have more than one working thread. The insertMessage method should find out with which thread it have to talk (this can be done only once in every window and then the thread is remebered in a local variable for reusing).
Abbout malicious code recheck many times. A quick look seems OK but better recheck.
6) To me this is perfectly logical. The Java virtual machine is a "simple" program in this case subprogram (see JNI). Multiple browser instances with the same JVM will bring much more complexity in the browser logic. Creating a separate process, inter process communication and much more. Think only to the JSObject. The internal and/or long_internal is probably just an address or index in a table of JavaScript objects which stays in the memory of the browser program. How to transfer all the stuf behind this to another process?
Bojan
4)
i) That is OK.
ii) Still OK.
If the two applications have the same Applet & codebase you should have more than one working thread. The insertMessage method should find out with which thread it have to talk (this can be done only once in every window and then the thread is remebered in a local variable for reusing).
Abbout malicious code recheck many times. A quick look seems OK but better recheck.
6) To me this is perfectly logical. The Java virtual machine is a "simple" program in this case subprogram (see JNI). Multiple browser instances with the same JVM will bring much more complexity in the browser logic. Creating a separate process, inter process communication and much more. Think only to the JSObject. The internal and/or long_internal is probably just an address or index in a table of JavaScript objects which stays in the memory of the browser program. How to transfer all the stuf behind this to another process?
Bojan
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP