Results 1 to 5 of 5
Thread: passing value from jsp to applet
- 10-06-2008, 02:16 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 3
- Rep Power
- 0
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.
- 10-06-2008, 04:17 PM #2
Let me restate this to be sure I understand what you are trying to do.how to pass value from jsp to applet at run time
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.
- 10-07-2008, 07:41 AM #3
Member
- Join Date
- Oct 2008
- Posts
- 3
- Rep Power
- 0
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 ?
- 10-07-2008, 08:23 AM #4
Member
- Join Date
- Oct 2008
- Posts
- 3
- Rep Power
- 0
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>
<jsp:plugin type="applet" code='net.sf.jftp.JFtpApplet' codebase="<%= request.getContextPath() %>/module/fs/bulklib"
width="250"
height="50"
archive="sjftp_mod.jar">
</jsp:plugin>
</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>
- 10-07-2008, 01:55 PM #5
Similar Threads
-
Passing a value..
By Lagarto in forum New To JavaReplies: 3Last Post: 01-23-2011, 05:58 PM -
Need help passing data between classes
By bri1547 in forum New To JavaReplies: 3Last Post: 07-21-2008, 04:19 AM -
Passing objects in Java
By jbostjr in forum Advanced JavaReplies: 1Last Post: 10-30-2007, 05:57 PM -
Passing the Values
By Lagarto in forum JDBCReplies: 1Last Post: 07-16-2007, 03:03 AM -
Applet, To center text and To open I engage in a dialog in an Applet
By Marcus in forum Java AppletsReplies: 4Last Post: 06-08-2007, 06:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks