Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OBJECT TAG

Posted on 2004-04-07
24
Medium Priority
?
256 Views
Last Modified: 2010-04-01
Hi Experts,

Can I and How to replace code within JSP to run applet using <OBJECT> tag with the applet using <APPLET> or anything else
to be able to access class from this applet ?

Thank you.
0
Comment
Question by:fpoyavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 6
  • 3
  • +2
24 Comments
 
LVL 1

Author Comment

by:fpoyavo
ID: 10774787
The reason is that with this tag I was not able to access anything and was given message that applet object does not exist but
in the IE status bar I see it is initiated, started, loaded.

Thank you.
0
 
LVL 28

Expert Comment

by:rrz
ID: 10774968
What did the Java Console report ?  
Please show us your code ?
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10775295
Can't figure out what you are trying to do here... can you post your code and point us what its not doing??
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:fpoyavo
ID: 10776510
I am trying to access class defined within applet via Javascript. It is a simple Applet.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10776691
I mean simple simple just for learning but it uses <OBJECT> tag . How to replace this <OBJECT> tag with <APPLET> but to
keep same functionality ?

Thank you.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10777025
<APPLET NAME='screenCapture' Code='ScreenCaptureApplet'  CODEBASE='../classes' width=100 height=100></APPLET>

and in the java script

document.screenCapture.captureImage(00,100,100,100,imgdescription);
                        

here captureImage is a method written inside the Applet..

I know it works
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10777264
I will try it today and get back. Thank you.
0
 
LVL 92

Expert Comment

by:objects
ID: 10779191
does your applet require the java plugin?  If it does then the <applet> tag will not work unless the user has the plugin setup as their default vm.

> and was given message that applet object does not exist

where are you getting this message.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10783672
So... here is the code :

<%
String someID = request.getParameter( "id" );
if ( someID == null ) someID = "-1";
%>
<html>
<head>
<title>MyApplet</title>
 

<script language="javascript">

function getmyid()
{

alert("started");

// I was trying too
//var appObj = document.getElementById('myapplet');
//var myid = appObj.getId();


// message that does not exist


var myid = document.myapplet.getID();


alert("here it is : " + myid);

}

</script>

</head>
<body bgcolor="#002341">
<img src="Submit.gif" onClick="getmyid()"></img>

<center>
 
<OBJECT classid = "clsid:CAFEEFAC-0014-0001-0000-ABCDEFFEDCBA" codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_1-windows-i586.cab#Version=1,4,1,0" WIDTH="100%" HEIGHT="100%">
      <param name="NAME" value="myapplet" MAYSCRIPT>
      <param name="CODE" value="com.sample.mybrowser.samplemybrowserApplet.class" width="50" height="50" MAYSCRIPT>
      <param name="ARCHIVE" value="sample.jar, nanoxml-2.1.1.jar, Browserutil.jar, Myutility.jar, dom.jar" MAYSCRIPT>
      <param name="type" value="application/x-java-applet;jpi-version=1.4.1">
      <param name="scriptable" value="true">
      <param name="browser" value="false">
      <param name="focusID" value="<%=someID%>">
      <param name="bgImage" value="background.gif">
      <param name="apachePort" value="8081">
      <param name="tomcatPort" value="8080">
     

    <COMMENT>
      <EMBED type = "application/x-java-applet;jpi-version=1.4.1" CODE="com.sample.mybrowser.samplemybrowserApplet.class" WIDTH="50%" HEIGHT="50%" scriptable="true" pluginspage="http://java.sun.com/products/plugin/index.html#download" MAYSCRIPT>
          <NOEMBED>
            alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
                    Your browser is completely ignoring the &lt;APPLET&gt; tag!
            </NOEMBED>
      </EMBED>
    </COMMENT>
</OBJECT>
</body>
</html>


It returns onclick that : "document.myapplet   is null or not an object"

How to make it work ?.

Please help.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10783724
Are you sure that your applet is getting loaded???
with the code given here, it looks like you are trying to load a applet from Sun site and not your own applet...

If your applet is getting loaded then you shd see a little coffee cup in your taskbar area ....

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10783924
i DO see that cup and message in status bar "myapplet is loaded" and it is working fine.

The problem is that I need to access class from this applet. I was thing that the problem was due to <OBJECT> tag use.

When use <APPLET> tag instead it does not load and I see "red cross" image in the left upper conner.


Please help.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10783934
correction: I was thinking that the problem was due to <OBJECT> tag use.
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 1000 total points
ID: 10784071
that means the class that you are loading is not an APPLET...!! go to java.sun site and look the documentation of the example class that you are loading....
it is quite possible that its not a applet but just a class and which case it will work with OBJECT tag but won't with APPLET..
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10784498
Is there any way to get it WORKING in <APPLET> ?
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10784553
Not if the class is not an APPLET
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10784644
Kuldeep,

Would you please look at another question I have :

http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20947874.html
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10786019
Do you think its possibly to download this class and make it APPLET ?
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10786292
you can defenitly try that...
I am willing to help you with that once you get the code of that class....
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 10787379
try this:

<APPLET CODE="com.sample.mybrowser.samplemybrowserApplet.class" archive="sample.jar, nanoxml-2.1.1.jar, Browserutil.jar, Myutility.jar, dom.jar" WIDTH=50 HEIGHT=50 NAME="myapplet" MAYSCRIPT>
     <param name="scriptable" value="true">
     <param name="browser" value="false">
     <param name="focusID" value="<%=someID%>">
     <param name="bgImage" value="background.gif">
      <param name="apachePort" value="8081">
      <param name="tomcatPort" value="8080">
</APPLET>
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10788195
Let me try. I will get back.
0
 
LVL 2

Expert Comment

by:anthony_castillon
ID: 10790510
Since you're using JSP, why don't you use the <jsp:plugin > action tag?.  In using it, you have to define the classname, among other things.  The beauty of this action tag is that the HTML code for the applet will be created to fit the browser you're working with, i.e., it will use the OBJECT tag or APPLET tag depending on the browser you're using.

You can also define parameters within the tag using the <jsp:params> tag.

Hope this helps.
Anthony
0
 
LVL 92

Expert Comment

by:objects
ID: 10795043
>  i.e., it will use the OBJECT tag or APPLET tag depending on the browser you're using.

Its more what vm's are being used that dictates which tag to use.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Files go missing when using DFS (Distributed File System) Replication and how to recover them and fix it.
Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question