Note that there are some explanatory texts on larger screens.

plurals
  1. POCopy folder in client machine using jsp applet
    primarykey
    data
    text
    <p>I am running an applet that will copy jar file in client machine .I am able to copy jar files using applet but when i am calling same Applet using jsp Appet is not working. Any idea how to perform that operation. I have singed my applet and i am not getting any exception also.</p> <pre><code>package APPLET; import java.applet.Applet; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; public class SET_UPFILE extends Applet { public void init() { File sourceFile = new File("G:\\KERALA\\ojdbc14.jar"); File destinationFile = new File("G:\\backup\\" + sourceFile.getName()); SET_UPFILE copyFileExample1 = new SET_UPFILE(); copyFileExample1.copyFile(sourceFile, destinationFile); } public void copyFile(File sourceFile, File destinationFile) { // System.setSecurityManager(null); try { FileInputStream fileInputStream = new FileInputStream(sourceFile); FileOutputStream fileOutputStream = new FileOutputStream(destinationFile); int bufferSize; byte[] bufffer = new byte[512]; while ((bufferSize = fileInputStream.read(bufffer)) &gt; 0) { fileOutputStream.write(bufffer, 0, bufferSize); } fileInputStream.close(); fileOutputStream.close(); } catch (Exception e) { e.printStackTrace(); } } } </code></pre> <p>And this is my jsp page calling that applet </p> <pre><code>&lt;%@page import="java.io.File"%&gt; &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt; &lt;%@page import="java.util.*"%&gt; &lt;%@page import="java.text.*"%&gt; &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//HI" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;applet&lt;/title&gt; &lt;script type="text/javascript"&gt; function startApplet(id) { var Projectpath=""; var ProjectPath = document.getElementById('Projectpath').value; alert(ProjectPath); id = ProjectPath+"//"+ProjectPath; appletsource="&lt;applet code='APPLET.SET_UPFILE.class' \n\ name='QuantumAeonGENIE1' \n\ id = 'QuantumAeonGENIE1' \n\ codebase='./' \n\ archive='MYAPPLET.jar' \n\ width='500' height='500' &gt;\n"; appletsource+="&lt;PARAM name='message' value='"+id+"'&gt;\n"; appletsource+="&lt;/applet&gt;\n"; document.getElementById("appletdiv").innerHTML=appletsource; } &lt;/script&gt; &lt;/head&gt; &lt;body leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px" SCROLL=NO&gt; &lt;form name="frmEntry" id="frmEntry" onsubmit="frmSave" method="post"&gt; &lt;div id="MainDIvReport" align="center"&gt; &lt;div id="FieldDiv"&gt; &lt;div id="toPrint1" &lt;center&gt; &lt;div id="TitleDivReport" align="center"&gt; &lt;b&gt;ETM ISSUES AND AUDIT -&gt; TICKET DOWNLOAD&lt;/b&gt; &lt;/div&gt; &lt;/center&gt; &lt;/div&gt; &lt;div id="appletdiv" style="text-align: center;"&gt; &lt;/div&gt; &lt;% File sourceFile = new File(""); String StrPath = sourceFile.getAbsolutePath(); // System.out.println(StrPath); %&gt; &lt;input type="hidden" id="Projectpath" name="Projectpath" value="&lt;%=StrPath%&gt;" &gt;&lt;/input&gt; &lt;table border="1" id="CntrlTABREPORT"&gt; &lt;tr&gt; &lt;td align="left" style="width: 85%;"&gt; &lt;/td&gt; &lt;td align="right" style="width: 15%;"&gt; &lt;div align="center" id="CntrlDivReport"&gt; &lt;table id="tab-button"&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="button" id="QAGenieCheckstatus" name="QAGenieCheckstatus" value="STATUS" onclick="startApplet(id)" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/br&gt; &lt;/br&gt; &lt;center&gt;&lt;h1&gt;&lt;/h1&gt;&lt;/center&gt; &lt;/div&gt; &lt;div id="toPrint"&gt; &lt;div style="display: none;"&gt; &lt;jsp:include flush="true" page="/DROPDOWN_1.jsp"&gt;&lt;/jsp:include&gt; &lt;/div&gt; &lt;div id="div-display-outer"&gt; &lt;div id="div-display"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;table border="0" width="100%" bgcolor="#085DAD" id="div-footer"&gt; &lt;tr&gt; &lt;td valign="bottom" align="center"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload