How i load java class through javascript
Hi,
i want to load java class file at client side through the java script. Class file wich already at client side(client machine)
tell me is it possible....
thanks
plzz mail
[email protected]
From your post it is not very clear what you want to do.
1. Even if it was possible to load client classes using javascript, how on earth are you going to execute them ??? JavaScript and java are entirely different cups of tea.
2. If it was an applet, then probably you can access some classes from the client machine. Definely the default packages. However, I don't know whether you can access other classes. That might lead to a security issue. Please check with a java securities expart.
3. Loading a class from the client machine is DEFINITELY A BAD PROGRAMMING PRACTICE Use the codebase property on your applet tag to load the classes from the server.
Similar Messages
-
How to load java class from jsp page?
hi all!
Does anyone know how to load java class from jsp page?
I try to load java class from jsp page.
Is it possible to load java class fom jsp page?
thanks and have a good day!What I mean is How to load/open java class file from jsp page?
I think we can open Applet from jsp page by using
<applet code=helloApplet.class width=100 height=100>
</applet>
but, how to open java class which is an application made by Frame?
thanks and have a good day -
How to call java classes from javascript?
i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
the class is stored under tomcats classes directory and is accessed:
com.Database.Employee
the method is called : UpdateEmployeeDetails
the button
<input type="button" value="Save" onclick="submitForm('save')" />the javascript
<script language="javascript">
function submitForm(process){
document.myForm.action="update.jsp";
document.myForm.submit();
</script>is it not possible?
do i have to refresh the page and read in the values like...
<%
String ename = request.getParameter( "EmployeeName");
session.setAttribute( "ename", ename);
%>and then call the class from here?
looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
is ajax better or not really worth it?
i have anything up to 100 fields that need saving at one save click -
How to use java class in pl/sql
Hai Guys,
here is my java class:
import java.io.*;
public class ListFiles
public static void main (String[] args)
File file=new File("C:\\");
File[] files=file.listFiles();
for(int fileInList=0; fileInList<files.length; fileInList++ )
System.out.println(files[fileInList].toString() );
i want to use this class in pl/sql, i am new about this topic my concern are following
how to load java class
how to use in pl/sql
Guys i'll be great-full to you if you could help me out or share link or document .First Read https://forums.oracle.com/forums/ann.jspa?annID=432
Check this link...
1. http://www.devshed.com/c/a/Oracle/Extending-PLSQL-with-Java-Libraries-concluded/
2. calling java from pl/sql in oracle 10g?its very urgent.
3. http://qamarsyed.blogspot.com/2010/07/calling-java-from-plsql-inside-oracle.html
4. http://home.c2i.net/toreingolf/oracle/java_and_plsql.htm
Hope this helps...
If someone response is helpful or correct, please mark it accordingly. -
How to call java function in javascript
Hello Everyone,
Can anyone tell me solution that:
How to call java function in javascript?
Thanks,
VIDsYou can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want. -
Load java class into the database 10g
Hi ,
We have a program which creates pdf files by using bi publisher.for this program we r using some java package to create a directory in unix whenever invoiceprint program runs.
Now i need to load this class into database,so how can i load this class into database.
I got some samples and docs from google but i was confused with those wether i should load from Oracle/applmgr user.
So Could any one please tell me how can i load java class into oracle database.
I am verymuch thankful for your kind help.Its an emergency issue for me.
Thanks,
YMRHi,
http://www.oracle-training.cc/teas_elite_util9.htm
SS -
Hello Friends,
I need a help regarding how to load a class manually.
i have the class name -- TestClass1
and Path - com.apps.classes
Thank youThank You------
I got the result
String classPath = com.apps.className;
Object obj = Class.forName(classPath).newInstance(); -
How to import java Classes in report Builder 10g
How to import java Classes in report Builder 10g .....
ArshadHello,
To import the Java classes:
Add your jar in the REPORTS_CLASSPATH
Launch Reports Builder.
Note:
You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
Choose Program > Import Java Classes to display the Import Java Classes dialog box.
Regards -
Accessing java classes from javascript
Hi,
I have the following javascript function
function testjava {
var myString = new java.lang.String("Hello world"); // line 1
alert("len:"+myString.length()); // line 2
}It gives me a error at line 1 saying "'java' is undefined" in IE browser 5.5 sp2. But, both the lines execute correctly in netscape 6.
Can someone please help..
Thanks,
Vijay.It seems that IE 5.5 doesn't support accessing java classes in JavaScript, so try to install IE 6 to see if it works or maybe, you doesn't have installed propertly support for JVM in IE.
-
How to decode java class file to java file
hi
how to decode java class file into java file
regards
kedarIts really.......... really BAD.
Write ur own code... or use open source code..
Its a bad practice...
however i am telling u ..there is DJ java decompiler.
but mind it there are Obfuscator also....like codeshield and others
take care...
Alok -
How to load Java applets on Gemxplore 3G card ? (APDU inside)
Hi,
Does anyone have experience on how to load Java applets into Gemxplore 3G card ?
I tried to load the tck applets into Gemxplore 3G card but the got sw 6985 for INSTALL FOR INSTALL Make Selectable
Here is the details on APDUs.
Do you know what is wrong ?
Regards
-guoqing
SELECT
*00 A4 04 00 07 A0 00 00 00 18 43 4D*
*61 1A [Normal ending of the command with <26> bytes of extra information.]*
INITIALIZE UPDATE
*80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)*
*43 4D 6D FF 23 B5 C4 13 20 1A 01 01 9F 15 97 A5 CE E9 CF A7 19 C6 8D F9 8B 9A 78 DB, 90 00 [Normal ending of the command.]*
EXTERNAL AUTHENTICATE
*84 82 01 00 10 EB 88 23 3C B6 4E 23 E9 69 1B 30 08 56 7A 1F 8F*
*90 00 [Normal ending of the command.]*
INSTALL FOR LOAD
*84 E6 02 00 24 09 A0 00 00 00 62 B0 BA A1 01 00 00 0E EF 0C C6 02 00 00 C8 02 00 00 C7 02 00 00 00 53 9D 96 C2 D4 8F 41 6B (00)*
*00, 90 00 [Normal ending of the command.]*
SELECT
*00 A4 04 00 07 A0 00 00 00 18 43 4D*
*61 1A [Normal ending of the command with <26> bytes of extra information.]*
INITIALIZE UPDATE
*80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)*
*43 4D 6D FF 23 B5 C4 13 20 1A 01 01 A5 57 A0 A0 00 7E 5A 3F A5 10 6A 37 69 16 AA 6F, 90 00 [Normal ending of the command.]*
EXTERNAL AUTHENTICATE
*84 82 01 00 10 28 BA 3A C4 D6 05 C9 C9 70 37 39 F1 7B 6D F8 80*
*90 00 [Normal ending of the command.]*
INSTALL FOR INSTALL Make Selectable
*84 E6 0C 00 36 09 A0 00 00 00 62 B0 BA A1 01 09 A0 00 00 00 62 B0 BA A1 81 09 A0 00 00 00 62 B0 BA A1 81 01 00 0C EF 08 C7 02 00 00 C8 02 00 00 C9 00 00 A4 CE 57 8B 19 F2 9E 0A (00)*
*69 85*
Edited by: guoqing on May 19, 2008 6:06 AM
Edited by: guoqing on May 19, 2008 6:20 AMI don't have any experience with GTO's cards, but one would expect they provide a user guide or a data sheet how to load applications.. Reasons could be:
1. Issuer policy to have a certain security level for content management --> raise the security level to C_MAC + ENC
2. Issuer policy this card is static --> no post-issuance -
How to call java class from pl/sql procedure ?
Hello everyone,
My query is..
There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
and the other thing is.. oracle is in one machine and java is in another .. :(
hope ..u can help me out !!
Thank in advance !!but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
so how to call java class file which is on another machine and oracle in another.. -
ANSWER: HOW TO DETECT Java Plugin from JavaScript
I created a new topic because the questions about
how to detect Java Plugin in browsers are scattered
thoughout this forum.
Basically you need to employ two approaches for IE and NS.
In IE you need to try to instantiate a small applet
(not your production applet) in order to see if browser
can do it. if the browser can do it, you can make a
call applet from JavaScript in order to find version of
JRE (as well as a host of other things).
In NS you can write a simple JavaScript which will
interrogate the browser for all plugins installed. Then
ypu can make a desicion whether to pass execution to
the next(or generated) page which hosts your applet,
or ask the user to download/install a plugin.
I ecourage everybody to host a plugin on your site
rather leave default link to it which is generated by
html converter.
In order to run sample,
Prerequisites:
Java Plugin 1.3.
If you have a different version of plugin,
substitute hardcoded plugin version in JavaScript for
value that you have.
1. compile java file
2. put class file in the same directory with html file
3. load html file into the browser.
4. press "Check Java Plugin.." button
5. see it work
6. examine code
7. uninstall plugin
8. repeat steps 1 - 4
9. see it work
10. install plugin.
Sample code follows:
**********************HTML FILE BEGIN***********
<HTML>
<HEAD>
<!-- Generated by Kawa IDE -->
<TITLE>Detect Java Runtime</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
var browsername;
function doNetscape()
for (i=0; i < navigator.plugins.length; i++)
for (j = 0; j < navigator.plugins.length; j++)
if(navigator.plugins[i][j].type == "application/x-java-applet;version=1.3")
alert("You are running Netscape with Java Plugin 1.3.0 - OK");
return;
alert("You are running Netscape\nPlease, install Java Runtime Environment 1.3.0");
function doMicrosoft()
var applet = document.myApplet;
if(applet == null)
alert("You are running Microsoft Browser.\nPlease, install Java Runtime Environment 1.3.0");
return;
var version = applet.getJavaVersion();
if(version == "1.3.0")
alert("You are running IE, Java Plugin 1.3.0 installed - OK");
else
alert("You are running IE, other plugin installed - mybe OK if later that 1.3.0\nYour version: " + version);
function getJava()
var applet = document.myApplet;
if(applet == null)
alert("Please, install Java Runtime Environment");
return;
alert("JRE Version: " + document.myApplet.getJavaVersion());
function checkJavaPlugin()
browsername = navigator.appName;
if(browsername.indexOf("Netscape")!= -1)
browsername="NS";
doNetscape();
else
if(browsername.indexOf("Microsoft")!=-1)
browsername="MSIE";
doMicrosoft();
else
browsername="N/A";
alert("Unknown browser: " + browsername);
</SCRIPT>
<body>
<Strong>Check Java Plugin</strong>
<OBJECT id="myApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 1
HEIGHT = 1 >
<PARAM NAME = CODE VALUE = "DetectPluginApplet.class" >
<PARAM NAME="scriptable" VALUE="true" >
<embed type="application/x-java-applet;version=1.3"
code = DetectPluginApplet width = 2 height = 2 MAYSCRIPT = "true" >
</embed>
</EMBED>
</object>
<FORM>
<INPUT TYPE="button" value="Get Plugin Version in IE" onClick="getJava()">
<INPUT TYPE="button" value="Check Java Plugin in NS and IE" onClick="javascript:checkJavaPlugin()">
</FORM>
</BODY>
</HTML>
**********************HTML FILE END***********
***************APPLET FILE BEGIN***********
import java.awt.*;
public class DetectPluginApplet extends java.applet.Applet
public void init()
add(new Label("DetectPluginApplet"));
public String getJavaVersion()
return System.getProperty("java.version");
**************APPLLET FILE END************Try following java script, it works on new browsers (NS 4+, IE5+). For IE you have to enable 'ActiveX objects creation' in security options.
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav4up = (is_nav && (is_major >= 4));
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.0") !=-1));
var is_ie5up = (is_ie && (is_major == 4)
&& ( (agt.indexOf("msie 5.0")!=-1)
|| (agt.indexOf("msie 5.5")!=-1)
|| (agt.indexOf("msie 6.0")!=-1) ) );
var pluginDetected = false;
var activeXDisabled = false;
// we can check for plugin existence only when browser is 'is_ie5up' or 'is_nav4up'
if(is_nav4up) {
// Refresh 'navigator.plugins' to get newly installed plugins.
// Use 'navigator.plugins.refresh(false)' to refresh plugins
// without refreshing open documents (browser windows)
if(navigator.plugins) {
navigator.plugins.refresh(false);
// check for Java plugin in installed plugins
if(navigator.mimeTypes) {
for (i=0; i < navigator.mimeTypes.length; i++) {
if( (navigator.mimeTypes[ i].type != null)
&& (navigator.mimeTypes[ i].type.indexOf(
"application/x-java-applet;jpi-version=1.3") != -1) ) {
pluginDetected = true;
break;
} else if (is_ie5up) {
var javaVersion;
var shell;
try {
// Create WSH(WindowsScriptHost) shell, available on Windows only
shell = new ActiveXObject("WScript.Shell");
if (shell != null) {
// Read JRE version from Window Registry
try {
javaVersion = shell.regRead("HKEY_LOCAL_MACHINE\\Software\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
} catch(e) {
// handle exceptions raised by 'shell.regRead(...)' here
// so that the outer try-catch block would receive only
// exceptions raised by 'shell = new ActiveXObject(...)'
} catch(e) {
// Creating ActiveX controls thru script is disabled
// in InternetExplorer security options
// To enable it:
// a. Go to the 'Tools --> Internet Options' menu
// b. Select the 'Security' tab
// c. Select zone (Internet/Intranet)
// d. Click the 'Custom Level..' button which will display the
// 'Security Settings' window.
// e. Enable the option 'Initialize and script ActiveX controls
// not marked as safe'
activeXDisabled = true;
// Check whether we got required (1.3+) Java Plugin
if ( (javaVersion != null) && (javaVersion.indexOf("1.3") != -1) ) {
pluginDetected = true;
if (pluginDetected) {
// show applet page
} else if (confirm("Java Plugin 1.3+ not found, Do you want to download it?")) {
// show install page
} else {
// show error page
} -
How to convert java .class file to .dll file
hi,
I got a problem, I have to convert my java .class file to .dll file. Microsoft VC++ program will invoke the converted .dll file.
Is there any other possibility.
I was confused.
Cam any body help me. If you are having solution for the can you send to my [email protected] account.
thanks,No, it is not possible to do what you are suggesting. Yes, you could produce a DLL that wraps the JVM and loads your java class exposing a C and/or C++ callable interface, but that is a lot to go through unless your class is VERY complex. Otherwise, you might want to just create and maintain two implementations.
-
How to load a Class Dynamically?
hi,
I have the following problem.I am trying to load a class dynamically.For this I am using ClassLoader and its Loadclass method.My code is like this,
File file = filechooser.getSelectedFile();
ClassLoader Cload = this.getClass().getClassLoader();
String tempClsname= file.getName();
Class cd =Cload.loadClass(tempClsname);
Object ob =(Object)cd.newInstance();
showMethods(ob);
In showMethods what i am doing is getting the public methods of the dynamically loaded class,
void showMethods(Object o){
Class c = o.getClass();
System.out.println(c.getName());
vecList = new Vector();
Method theMethods[] = c.getDeclaredMethods();
for (int i = 0; i < theMethods.length; i++) {
if(theMethods.getModifiers()==java.lang.reflect.Modifier.PUBLIC)
String methodString = theMethods.getName();
System.out.println(methodString);
vecList.addElement(methodString);
allmthdlst.setListData(vecList);
Now whenever i work with this i m getting a runtime error of CLASS NOT FOUND Exception..I know its because of Classpath..But i don't know how to resolve it??pls help me in this regard...
Also previously this code was working with java files in the directory in which this java file was present..How to make it work for java file in some other directory..pls help me in this regard...
Thanks in advance..You sure didn't need to post this twice.
http://forum.java.sun.com/thread.jsp?thread=522234&forum=31&message=2498659
When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].
You resolve this problem by ensuring the class is in the classpath and you refer to it by its full name.
§
Maybe you are looking for
-
hi- it seems that after i downloaded and installed midp4palm and j2me_cldc 1.0.2 the lcdui and midlet classes are both missing. i browsed to the cldc folder on my computer and checked in all the subfolders there. in the javax/microedition/ folder, on
-
hi sap guru's i am working with us client they need FORM W9 AND 1099 they mention third party payment. how to generate these forms is it through withholding tax ????? pls help me raju
-
Header Mapping in File to IDoc
Hi all, When do we go for Header mappin in File - IDoc scenario? How we can configure these steps in XI? regards, Anjaneya
-
How to move my music library to a new computer
just got an Ipod touch and an Iphone 5, how do I move my music libraty to my new computer?
-
How can I permaently increase the defaut font size in Mozilla
the default font size used by Mozilla is way too tiny for me. How can I permanently increase it?