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

Discussion in 'Java' started by Jean-Paul Lanaux, May 16, 2004.

  1. 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
    Jean-Paul Lanaux, May 16, 2004
    #1
    1. Advertising

  2. Jean-Paul Lanaux

    Chris Smith Guest

    Jean-Paul Lanaux wrote:
    > 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
    Chris Smith, May 16, 2004
    #2
    1. Advertising

  3. Jean-Paul Lanaux

    Roedy Green Guest

    On Sun, 16 May 2004 14:04:24 GMT, Jean-Paul Lanaux <>
    wrote or quoted :

    > Can I do this from a jar file
    >without having to use certificates and/or java policy file
    >modifications.


    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.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, May 16, 2004
    #3
  4. Jean-Paul Lanaux

    Roedy Green Guest

    On Sun, 16 May 2004 14:45:54 -0400, perry <> wrote
    or quoted :

    >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.


    see http://mindprod.com/jgloss/remotefileaccess.html
    for your options.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, May 16, 2004
    #4
  5. Jean-Paul Lanaux

    perry Guest

    Re: Is it possible to write an applet that reads image and data filesfrom web server that is easy for end users?

    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

    Jean-Paul Lanaux wrote:
    > 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
    >
    perry, May 16, 2004
    #5
  6. Jean-Paul Lanaux

    Steve Burrus Guest

    Re: Is it possible to write an applet that reads image and data filesfrom web server that is easy for end users?

    >Jean-Paul Lanaux wrote:
    > .....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!
    Steve Burrus, May 16, 2004
    #6
  7. In article <>, look-
    lid says...
    > On Sun, 16 May 2004 14:04:24 GMT, Jean-Paul Lanaux <>
    > wrote or quoted :
    >
    > > Can I do this from a jar file
    > >without having to use certificates and/or java policy file
    > >modifications.

    >
    > 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-
    Jean-Paul Lanaux, May 17, 2004
    #7
  8. On Mon, 17 May 2004 07:27:14 GMT, Jean-Paul Lanaux wrote:

    > 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?

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, May 17, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roland Poellinger
    Replies:
    1
    Views:
    1,283
    Ryan Dillon
    Mar 12, 2005
  2. Replies:
    3
    Views:
    345
    Roedy Green
    Nov 19, 2005
  3. Replies:
    5
    Views:
    474
    Roedy Green
    Mar 28, 2006
  4. Selbourne makhomo

    how to write a python program tht reads (x,y)

    Selbourne makhomo, May 16, 2004, in forum: Python
    Replies:
    0
    Views:
    351
    Selbourne makhomo
    May 16, 2004
  5. John Hunter
    Replies:
    0
    Views:
    613
    John Hunter
    May 16, 2004
Loading...

Share This Page