This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java writing to xml Simple problem?(code included) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Java writing to xml Simple problem?(code included)" Watch "Java writing to xml Simple problem?(code included)" New topic
Author

Java writing to xml Simple problem?(code included)

torsti koistinen
Greenhorn

Joined: Jul 29, 2004
Posts: 4
Here is my problem, in my Java applet i got this textfield(txtNormalHours) and button(xml).
When I press this button program should create file foo.xml, but nothing happens, no errors.
Here is the funny part without that button code works fine and foo.xml is cr
Paul Michael
Ranch Hand

Joined: Jul 02, 2001
Posts: 697
Hi torsti!

Maybe we can try running your code together?

But I think you might have forgotten to post it here.



SCJP 1.2 (89%), SCWCD 1.3 (94%), IBM 486 (90%), SCJA Beta (96%), SCEA (91% / 77%), SCEA 5 P1 (77%), SCBCD 5 (85%)
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Some time in the past, I used to face security problem using applet and file I/O... We need to take care of the security issue coming with applets, accessing the file system...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
According to Java, Applet is not allowed to write anything to the file system. If you really wanna do so, you need to configure the SecurityManager of the JVM, so that writing things into the file system is allowed.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Nicholas Cheung:
According to Java, Applet is not allowed to write anything to the file system. If you really wanna do so, you need to configure the SecurityManager of the JVM, so that writing things into the file system is allowed.

Nick


How to config SecurityManager ???


Answer ::

http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/security.html


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by somkiat puisungnoen:


How to config SecurityManager ???


Answer ::

http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/security.html


Asking and answering at the same time...
 
GeeCON Prague 2014
 
subject: Java writing to xml Simple problem?(code included)