HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: SWB Mozilla JDK Applet behaviour on VMS
Operating System - OpenVMS
1832284
Members
1782
Online
110041
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
Forums
Discussions
Discussions
Discussions
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
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
07-08-2007 01:10 PM
07-08-2007 01:10 PM
Hi,
Can someone please clarify what VMS Secure Web Browser would pass back to JavaScript when an Applet Method returns an object of type java.lang.String?
Firefox returns a java.lang.String object (including all its Java methods) but Internet Explorer returns a JavaScript.DOM.String (including all its JavaScript methods) but what does SWB do? (And why :-)
If both FF and SWB are Mozilla-based then I'd imagine they both behave the same way, but has anyone seen it written down somewhere (perhaps on Sun's website?) as to what *should* happen?
Cheers Richard Maher
FYI the following is posted in comp.lang.java.programmer and comp.lang.javascript: -
"Richard Maher" wrote: -
> Hi,
>
> The following is a huge variance in behaviour between Firefox and Internet
> Explorer (that I think I'm seeing) when it comes to what is returned to the
> JavaScript when a Java Applet method has been invoked. If someone could
> explain why this may be, or if there is something that could be done at the
> Applet end to make the behaviour consistent between the browsers, that would
> be great. The issue is this: -
>
> I use 'chan = document.getElementById("CornuCopiae");' to setup the
> JavaScript variable 'chan' to reference my applet class and then proceed to
> invoke various methods such as 'msgQue = chan.getString(0,queNameLen);' In
> this case the getString() method returns queNameLen bytes (31) from a socket
> stream starting at offset zero. So far everything is peachy and both IE and
> FF have returned String objects containing the appropriate 31 bytes; the
> problem is that IE has returned a JavaSCRIPT String object and FF has
> returned a java.lang.String object.
>
> With IE I then proceed to trim my msgQue JavaScript VARiable with
> msgQue.rTrim() and it works great, but when I try the same thing with FF I
> get "Unable to convert JavaScript value /^\$+/ to java value of type char"
> which confuses the hell out of me! (especially when the trim() method
> appears to work normally)
>
> rTrim() is defined as per the JavaScript FAQ: -
>
> String.prototype.rTrim =
> function()
> {
> return this.replace(/\s+$/,'');
> }
>
> So after re-reading the error message a few times, and getting another one
> that complains that some other method doesn't occur in java.lang.String, I
> start testing a few things (like startsWith()) and discover that FF gives me
> an in tact java.lang.String object complete with all its methods (but won't
> honour my JS prototyping) but IE does some massaging and transforms the java
> object to a javascipt object before handing it over. Error "Object does not
> support property or method". Does that sound about right to everyone else?
>
> If truth be told, I'd have to say I much prefer the FF version but how then
> can I cast the j.l.String object as a standard JavaScript so that my script
> code can work with it as any other JavaScript string? (VAR normalPlease =
> fromApplet renders normalPlease as a java.lang.String object. [Even though
> the construct says its a String function native code])
>
> As always, all helpful advice and experiences appreciated.
>
> Cheers Richard Maher
>
>
Can someone please clarify what VMS Secure Web Browser would pass back to JavaScript when an Applet Method returns an object of type java.lang.String?
Firefox returns a java.lang.String object (including all its Java methods) but Internet Explorer returns a JavaScript.DOM.String (including all its JavaScript methods) but what does SWB do? (And why :-)
If both FF and SWB are Mozilla-based then I'd imagine they both behave the same way, but has anyone seen it written down somewhere (perhaps on Sun's website?) as to what *should* happen?
Cheers Richard Maher
FYI the following is posted in comp.lang.java.programmer and comp.lang.javascript: -
"Richard Maher"
> Hi,
>
> The following is a huge variance in behaviour between Firefox and Internet
> Explorer (that I think I'm seeing) when it comes to what is returned to the
> JavaScript when a Java Applet method has been invoked. If someone could
> explain why this may be, or if there is something that could be done at the
> Applet end to make the behaviour consistent between the browsers, that would
> be great. The issue is this: -
>
> I use 'chan = document.getElementById("CornuCopiae");' to setup the
> JavaScript variable 'chan' to reference my applet class and then proceed to
> invoke various methods such as 'msgQue = chan.getString(0,queNameLen);' In
> this case the getString() method returns queNameLen bytes (31) from a socket
> stream starting at offset zero. So far everything is peachy and both IE and
> FF have returned String objects containing the appropriate 31 bytes; the
> problem is that IE has returned a JavaSCRIPT String object and FF has
> returned a java.lang.String object.
>
> With IE I then proceed to trim my msgQue JavaScript VARiable with
> msgQue.rTrim() and it works great, but when I try the same thing with FF I
> get "Unable to convert JavaScript value /^\$+/ to java value of type char"
> which confuses the hell out of me! (especially when the trim() method
> appears to work normally)
>
> rTrim() is defined as per the JavaScript FAQ: -
>
> String.prototype.rTrim =
> function()
> {
> return this.replace(/\s+$/,'');
> }
>
> So after re-reading the error message a few times, and getting another one
> that complains that some other method doesn't occur in java.lang.String, I
> start testing a few things (like startsWith()) and discover that FF gives me
> an in tact java.lang.String object complete with all its methods (but won't
> honour my JS prototyping) but IE does some massaging and transforms the java
> object to a javascipt object before handing it over. Error "Object does not
> support property or method". Does that sound about right to everyone else?
>
> If truth be told, I'd have to say I much prefer the FF version but how then
> can I cast the j.l.String object as a standard JavaScript so that my script
> code can work with it as any other JavaScript string? (VAR normalPlease =
> fromApplet renders normalPlease as a java.lang.String object. [Even though
> the construct says its a String function native code])
>
> As always, all helpful advice and experiences appreciated.
>
> Cheers Richard Maher
>
>
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 07:37 PM
07-08-2007 07:37 PM
Solution
Richard,
Try to convert the msgQue variable to an javascript String. You can do that with:
msgQue = msgQue + "";
The "" is an empty string. This will probably work on both browsers.
Another way is to rewrite the rTrim function:
String.prototype.rTrim =
function()
{
return (this + "").replace(/\s+$/,'');
}
Bojan
Try to convert the msgQue variable to an javascript String. You can do that with:
msgQue = msgQue + "";
The "" is an empty string. This will probably work on both browsers.
Another way is to rewrite the rTrim function:
String.prototype.rTrim =
function()
{
return (this + "").replace(/\s+$/,'');
}
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 08:55 PM
07-08-2007 08:55 PM
Re: SWB Mozilla JDK Applet behaviour on VMS
Hi Bojan,
Thanks for the reply; as usual you're a bloody marvel, and the change to the prototype worked. I had gotten around the problem via the convenient select list array that I was using: - options[n] = new Option(msgQue,msgQue); options[n].text.rTrim(); but your method is obviously more generic and robust.
Just another example of Browser Life's rich tapestry I suppose :-)
So where do I send your Tier3 Hobbyist License and kit to? (DEMO example now supports Firefox and (in the continued absence of IPSec) SSL if you STUNNEL the Tier3 servers. You know you want a piece o' that!)
Cheers Richard Maher
Thanks for the reply; as usual you're a bloody marvel, and the change to the prototype worked. I had gotten around the problem via the convenient select list array that I was using: - options[n] = new Option(msgQue,msgQue); options[n].text.rTrim(); but your method is obviously more generic and robust.
Just another example of Browser Life's rich tapestry I suppose :-)
So where do I send your Tier3 Hobbyist License and kit to? (DEMO example now supports Firefox and (in the continued absence of IPSec) SSL if you STUNNEL the Tier3 servers. You know you want a piece o' that!)
Cheers Richard Maher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 09:13 PM
07-08-2007 09:13 PM
Re: SWB Mozilla JDK Applet behaviour on VMS
Richard,
You can contact me by mail: bojan at alba dot si
Cheers
Bojan
You can contact me by mail: bojan at alba dot si
Cheers
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP