Is it possible to write an applet that reads image and data files from web server that is easy for e

J

Jean-Paul Lanaux

My background:

4th year computer science student.

The school that I am studying at teaches a lot of java, but they haven't
ever touched upon applets. I don't have much experiance with applets and
I find that applets are excercising my patience. I thought I would
attempt to write an involved applet and the program I was writing was
working very well and I was pleased with the way it as coming out. I
then put it on a web server and discovered all of the security problems
with running applets off of the web. I am at a point now where I might
want to totally abandon the project using java and move over to c++ and
just write an app that uses an exe.

I have done a lot of searching on the net for the info that seems to be
eluding me. I am searching for and It is not clear to me if I can do
what I wish to do without all of the damn security exceptions.

My main question:

I want to develop an application that runs from a browser window as an
applet using Java. I want to be able to read files from the same server
and directory structure which has the html files. The files that I would
be reading would be jpg's and gif's and either text files or binary
files for the data. It would also be nice to write to the directory, but
at this point I would just be satisfied to be able to just read files.

The users that I expect to use this applet are not expected to be very
competant computer users. It is very important that the applet just run
from a link or other simple method. Can I do this from a jar file
without having to use certificates and/or java policy file
modifications.

I don't want to give up on java just yet, but this security thing is
killing it for me.

I have even thought about planting the data within the source code, but
that to me seems too damn messy, and just plain wrong.

I would just like if people could tell me one way or another if my
program would be possible.

Jean-Paul Lanaux
 
C

Chris Smith

Jean-Paul Lanaux said:
I want to develop an application that runs from a browser window as an
applet using Java. I want to be able to read files from the same server
and directory structure which has the html files. The files that I would
be reading would be jpg's and gif's and either text files or binary
files for the data. It would also be nice to write to the directory, but
at this point I would just be satisfied to be able to just read files.

Yes, you can do the reading part. If you want to know what's wrong with
your code, you'll have to post a short example that demonstrates the
problem.

As for the writing part, web servers don't typically provide a way to
write to their directories (for obvious reasons). You can write to the
server, IF the server is running an appropriate service such as FTP or
such, and you don't mind giving out the password to the world. If you
have more control over the server, you could also write your own service
of sorts, which would allow only the kind of writes you want, and no
more.
I don't want to give up on java just yet, but this security thing is
killing it for me.

There are, incidentally, other options besides applets for writing Java
code to do this sort of thing. Writing a Java application would be just
as easy as writing a C++ application to perform these tasks, assuming
you know Java already...

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
P

perry

i'm not sure of the all the details of the application you are
describing and true, applets have a few restrictions but with good reason.

from what you have described, there is nothing wrong with collecting
information via the standard practise and having that sent to the server
for proper storage. i don' know if this is what you meant with writing
files to the server. the whole idea of the applet/servlet or
applet/server relationship is that each would focus on tasks that are
appropaite for each.

as for accessing gifs/jpgs from the server, sure. as for writing images
(i'm assuming) back. there's a couple approaches other than what was
mentioned. i don't see any need in your app to capture or store altered
images, if so, a trip down the JMF framework might be appropiate. but if
all your storing is user choices or responses, send that information to
the server or servlet and let it do the writing to the server files.

if you sit back and think about it, not letting applets write to server
files should make sense.. do some research on different types of
applet/server relationships available. you might even consider JavaSpaces.

- perry
 
S

Steve Burrus

Jean-Paul Lanaux said:
.....My main question:

I want to develop an application that runs from a browser window as an
applet using Java. I want to be able to read files from the same server
and directory structure which has the html files. The files that I would
be reading would be jpg's and gif's and either text files or binary
files for the data. It would also be nice to write to the directory, but
at this point I would just be satisfied to be able to just read files.
....

Jean-Paul, I really haven't read ALL of the various responses back to
your original post just yet, but I would "echo" all of those responses
that have urged u to please send to us the applet code that you are now
working with!
 
J

Jean-Paul Lanaux

look- said:
To read images from jar files, or the server see
http://mindprod.com/jgloss/image.html

Also see http://mindprod.com/fileio.html
to see how to do HTTP gets to fetch them from a server at the socket
level.
I am going to attempt to figure this out with the info I received from
this group. If I can't figure it out, I will post the code.

I was working on this project between semesters, and I put it down in
January. School just finished so I would like to pick it up again. But
in the mean time I have to get back up to speed with the code.

Thanks to all that responded.
-jpl-
 
A

Andrew Thompson

I am going to attempt to figure this out
with the info I received from this group.
If I can't figure it out, I will post the code.

Linking to it at Geocities might be a
better idea, especially since it is
an applet(!). If posting to the group
itself, it is important to keep it short.

For tips..
<http://www.physci.org/codes/sscce.jsp>

But ..you are only going to post if
you have a problem?

What about if you create a wonderful
applet.. Is the source going to be
secret?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top