Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-06-2008, 04:16 PM
Member
 
Join Date: Oct 2008
Posts: 3
bhupendrabjain is on a distinguished road
passing value from jsp to applet
Hi



I have been stuck with jftp applet for a long time. I don’t have any idea about how to pass value from jsp to applet at run time.



The current JFtpApplet code is given below



Public class JFtpApplet extends Applet

{

Public JFtpApplet ()

{

AccessController.doPrivileged (new PrivilegedAction())

{

Public Object run ()

{

JFtp.main(new String[0]);



return new Object();

}

});

}



This class internally calls the main method of JFTP class which will start the applet. The main method normally takes string array as an input parameter. I want this string array to be initialized in the JFtpApplet class and the value to this array has to be passed from JSP. Is it possible with the current design of JFtpApplet class to take the value from jsp? If yes then can u give me a sample code where this has been done? Is there any flaw in the JFtpApplet code because

I have tried using getParameter method (this approach was given on net) in the JftpApplet class but have not been able to see the value getting passed from jsp to applet.



Thank you.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-06-2008, 06:17 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
Quote:
how to pass value from jsp to applet at run time
Let me restate this to be sure I understand what you are trying to do.
Your jsp code on a server generates some HTML that includes an <APPLET tag in response to a browser's request.
The browser that reads the generated HTML and then reads the java class files or jar file for the applet. The applet starts execution.
At this point you want applet get a value from the jsp. Is that it?
The applet can either get the value from a <PARAM tag that would be generated by the jsp when it created the HTML or it could use an HTTP connection to request the info from the server.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-07-2008, 09:41 AM
Member
 
Join Date: Oct 2008
Posts: 3
bhupendrabjain is on a distinguished road
Thanks
Thanks for the reply . You have understood it correctly what i want to do

Can u give me some sample code for doing the same i have already tried what you are saying but have not succeeded it al . Can you give me both the jsp code where the param tag is used to pass parameter and applet code where the parameter can be retrieved ?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-07-2008, 10:23 AM
Member
 
Join Date: Oct 2008
Posts: 3
bhupendrabjain is on a distinguished road
Hi
For your reference i will show you my jsp code
<html>
<head>
<title>Simfonie Bulk Upload Applet</title>
</head>
<body>
<h1><b>Simfonie Bulk Upload Applet<b></h1>
<hr>
<jsplugin type="applet" code='net.sf.jftp.JFtpApplet' codebase="<%= request.getContextPath() %>/module/fs/bulklib"
width="250"
height="50"
archive="sjftp_mod.jar">
</jsplugin>
</body>
</html>

My sjftp_mod.jar is in the bulklib folder but using java plug-in is always giving me this error
ServletException in '/module/fs/jsp/fsBulkUpload.jsp': /module/fs/jsp/fsBulkUpload.jsp(8,69) attribute for %>" is not properly terminated

I am able to run it using the following in my jsp
<applet java_codebase="<%= request.getContextPath() %>/module/fs/bulklib"
archive='sjftp_mod.jar' code='net.sf.jftp.JFtpApplet' height=500
width=500></applet>
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 10-07-2008, 03:55 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
I'd first design the HTML code to be generated, then code the jsp to generate that code. Do you have the HTML that you want?
What you show doesn't have the <PARAM tag in it.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help passing data between classes bri1547 New To Java 3 07-21-2008 06:19 AM
Passing objects in Java jbostjr Advanced Java 1 10-30-2007 07:57 PM
Passing a value.. Lagarto New To Java 0 08-01-2007 06:32 PM
Passing the Values Lagarto Database 1 07-16-2007 05:03 AM
Applet, To center text and To open I engage in a dialog in an Applet Marcus Java Applets 4 06-08-2007 08:15 AM


All times are GMT +3. The time now is 07:33 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org