Solved

applet to jsp

Posted on 2004-04-03
22
1,425 Views
Last Modified: 2008-02-01
Hi Experts,

I have applet running within my jsp. I pass some param.

<param name="CustID" value="1">      

How can I retrieve this param CustID back from APPLET ?

Thank you.
0
Comment
Question by:fpoyavo
  • 11
  • 7
  • 4
22 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10749910
you can use js to call the applet to return the parameter but why would u need to as the jsp page already has the value?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750249
The problem is that this applet when it is used by the user may modify this CustID ...so I need to know the new one.

How exactly I can do that ?
0
 
LVL 92

Expert Comment

by:objects
ID: 10750285
Add a public method to your applet to return the custid, and call the applet from js to retrieve it.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750332
Objects,

You are the best. May you give me some simple code sample ?

Thank you.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750337
I need to get this CustID whenever user clicks within applet area.
0
 
LVL 92

Expert Comment

by:objects
ID: 10750430
> I need to get this CustID whenever user clicks within applet area.

for what purpose?  what do u need to do with the value
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750456
I need it to process another jsp.

Please.
0
 
LVL 92

Expert Comment

by:objects
ID: 10750468
But why do you need it everytime user clicks within applet?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750548
:) objects. just help me and don't ask me why.
0
 
LVL 92

Expert Comment

by:objects
ID: 10750559
Was just asking because it may affect the way you achieve it :)

You should either call the applet using javascript,
or have the applet call a javascript function.
Whichever is most appropriate in your situation.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750715
I was trying to do that:

like you adviced :

in my javascript which I have tried to run directly and from .js
function getnewid()
{
var newid = document.myApplet.appletmethod();
alert ("here it is : " + newid);
}

it is in <img src="mybutton.gif" onclick="getnewid();">

when I click nothing is happening...no errors no nothing. I have inserted MAYSCRIPT in the CODE line but nothing is going on.

Hmmmm. ??? Please .
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:fpoyavo
ID: 10750717
It actually give a warning in line where my <img>  that object is expected when I click on image.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750725
I have puted just alert("javascript is started") in onclick event and it does not show up. What the .... is this ?
0
 
LVL 92

Expert Comment

by:objects
ID: 10750813
Perhaps img tag does not support onclick, test with:

function getnewid()
{
alert ("Here");
}
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10750875
Ok. I see you trying to drive me crazy :) bye. Wish you luck. IMG always supported onclick and I hope you are kidding :)

PLEASE CLOSE THIS QUESTION.
0
 
LVL 92

Expert Comment

by:objects
ID: 10750889
if you use the function I posted above does the alert() get displayed?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10751935
Objects :),

I told you that I was trying it and there is no alert.
May be it has to do with JSP ?

forget about it.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10752396
try to change you name of applet form myApplet to myapplet (all lowercase). or use document.applets[0]
make sure the method name must be exactly the same as you defined in applet, case sensitive.

http://www.apl.jhu.edu/~hall/java/Java-from-JavaScript.html
http://www.apl.jhu.edu/~hall/CWP-Sources/CWP-Examples/Chapter19/MoldSimulation.html (view source)
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 500 total points
ID: 10752424
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10752431
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10752473
Thanks a lot. Great sample.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10752568
glad to know and my pleasure :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
what is stuck threads? 3 97
logging jar 1 106
String format issue 13 90
runtime exception and error differences 4 72
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now