JavaScript to Java Communication - Packages Object in LiveConnect
In my previous post I explained about the JavaScript to Java Communication and the LiveConnect. Here I like to continue the with that. If a Java class is not part of the java, sun, or netscape packages, you access it with the Packages object. For example, suppose you created your own package like "org.eID.client.Desktop" which uses a Java package contain various Java classes like XMLparser.java, WSClient.java, ConnectTOApplication.java and ect.. ect.. that it implements for my project. To create an instance of the ConnectTOApplication class in org.eID.client.Desktop, you access the constructor of the class as follows: var red = new Packages.org.eID.client.Desktop.ConnectTOApplication(); You can also access classes in the default package (that is, classes that don't explicitly name a package). For example, if the HelloWorld class is directly in the CLASSPATH and not in a package, you can access it as follows: var helloWorld = new Packages.HelloWorld(); The LiveConnect java, sun, and netscape objects provide shortcuts for commonly used Java packages. For example, you can use the following: var myName = new java.lang.String("My name is Subanu"); instead of the longer version you can use like this : var myName = new Packages.java.lang.String("My name is Subanu"); I think this would definitely help you to understand how we can use the the Packages Object in LiveConnect. Enjoy :)
- SUDO shell command and sudoers file
- First Day in Aeturnum 16.04.2009
- Project eID selected to ICAMES 2009
- Firefox 3.5 is Released
- Create the Bookmark through JavaScript
- How to speedup your Firefox browser
- Enable spell check in text fields in Firefox
- How to change the Firefox Profile folder
- Remove Byte Order Mark (BOM) characters from XML in Java
- Funny thinks started to happenes.
- What is @SuppressWarnings Annotation in Java
- Display Post Summary hack for blogger
- How to define a Statistics widget for blogger
- JavaScript to Java Communication - Packages Object in LiveConnect
- JavaScript to Java Communication
- Starbucks in Sri Lanka
- Paper : Privacy enhanced data management for an electronic identity system : Available in IEEE Xplore
- Asynchronous Messaging and JMS
- Incremental schema updates through the hibernate
- What is Payment Gateway
This Articles was posted on 8:04 PMFriday, January 9, 2009
|
Labels:
Experiences,
Firefox,
Java,
JavaScript,
Project work
|
0 comments:
Post a Comment