Re: save input from web form to a .dat file
Nancy.Nicole@gmail.com wrote:
I'm trying to get the input from the user to a .dat file that I can
sort, read, etc. internally. However, I am having problems with
DataAccessor.load() --> It throws an exception...
...What exception?
A CodeIsFormingAnIndependentRepublicException exception?
Something else**, perhaps?
...perhaps part of the problem?
Exceptions, especially ones that cannot be readily
explained, often are part of the problem.
Here is the method from the class that is the applet:
Is your applet signed?
public int save(String agency, String producer, String insured, String
I will trim most of your 180 lines of code snippets*,
to point out that any applet that performs actions
that require 'trust' will fail in an unsigned applet.
public static void save(EntrySorter entryList)throws IOException{
FileWriter fw = new FileWriter(file);
...
Do you know what the problem is? I really need to figure this out and I
just can't seem to.
...and getting access to writing a file on the end user's
machine is something that is only accessible to a
'trusted' applet. That applet gains this by being signed
and accepted by the user.
* As an aside, please refrain from posting 180 lines of
code snippets. Code snippets are usually not that helpful
in solving code problems (I am simply making random
guesses about a very common problem).
Further, it rarely requires 180 lines of code to express
a problem. I note that in line after line of your posted
snippets, there were very similar code - did you try
trimming or commenting entire sections of that code
to confrim that the problem perstisted?
Much more effective for communicating a problem
(and shorter, in this instance) would be an SSCCE,
for more explanantion and tips, read here..
<http://www.physci.org/codes/sscce/>
Just before I forget, there are a lot of places in the
code where it catch's an Exception but proceeds
processing. I suggest you change any code like..
try {
....do stuff
} catch(Exception e) {
...do other stuff
}
To..
try {
....do stuff
} catch(Exception e) {
e.printStackTrace();
...do other stuff
}
** Then it should be possible to give us more details
on those exceptions. ;-)
HTH
Andrew T.