I have embedded the signed applet in following html page,
<input type="hidden" name="xmldata" id="xmldata" value=""/开发者_如何学C>
<APPLET CODE="com.syntel.upload.readFileApplet.class" ARCHIVE="sign-upload.jar" HEIGHT="200" WIDTH="475" ALIGN="bottom">
This browser does not appear to support Applets.
</APPLET>
Following readFileApplet class read the xml file from client filesystem ,
public class readFileApplet extends Applet {
StringBuffer strBuff;
public void init() {
add(txtArea, "center");
readFile();
String xmldata = strBuff.toString();
//TODO: set the xmldata string to html hidden variable
}
public void readFile() {
String line;
try {
InputStream in = new FileInputStream("c:\\ftlmb\\finstmt.xml");
BufferedReader bf = new BufferedReader(new InputStreamReader(in));
strBuff = new StringBuffer();
while ((line = bf.readLine()) != null) {
strBuff.append(line + "\n");
}
} catch (IOException e) {
txtArea.append(e.getMessage());
}
}
}
I am able to read the xml using applet but unable to set the xmldata string to hidden variable "xmldata" which is in html page.
Is there any API which i can use to get the DOM so that i can set the value to hidden variable.
Please help me out to solve this problem.
com.sun.java.browser.dom.DOMService
See http://www.javaworld.com/javaworld/jw-06-2005/jw-0627-plugin.html?page=3
精彩评论