Java server access

Discussion in 'Java' started by James David Miller, Nov 3, 2003.

  1. I have a javaApplet that needs to access a directory on the server, list
    the files in directory, then access the selected file. My first idea
    was to use a servlet on the server then I found out that the server that
    this needs to work with doesn't support servlets or Tomcat. The server
    supports PHP and CGI and the hosting company does not want to add java
    support.
    Can anyone give me an idea on how to go about this?

    David Miller
    James David Miller, Nov 3, 2003
    #1
    1. Advertising

  2. "James David Miller" <> wrote in message
    news:cwkpb.67993$275.175579@attbi_s53...
    > I have a javaApplet that needs to access a directory on the server, list
    > the files in directory, then access the selected file. My first idea
    > was to use a servlet on the server then I found out that the server that
    > this needs to work with doesn't support servlets or Tomcat. The server
    > supports PHP and CGI and the hosting company does not want to add java
    > support.
    > Can anyone give me an idea on how to go about this?
    >
    > David Miller
    >


    Depending upon what you mean by "access", it is possible to do the above
    without even using an applet. Simply have a URL which specifies the name of
    the directory you wish to access.

    Something like http://server/list/directory_name

    On the server side, either via PHP or CGI, parse the URL for the command
    "list", and the directory name "directory_name", return an HTML response
    which has the list of the files in the directory in a list box.

    Handle the submission from the client of a selected file, and provide as a
    response whatever constitutes "access" to it.

    Of course, you may want to get fancy in your output and selection, but that
    is the gist of it. Of course, other solutions are possible.

    HTH,


    --
    Shripathi Kamath
    NETAPHOR SOFTWARE INC.
    http://www.netaphor.com
    Shripathi Kamath, Nov 3, 2003
    #2
    1. Advertising

  3. Shripathi Kamath wrote:

    >"James David Miller" <> wrote in message
    >news:cwkpb.67993$275.175579@attbi_s53...
    >
    >
    >>I have a javaApplet that needs to access a directory on the server, list
    >>the files in directory, then access the selected file. My first idea
    >>was to use a servlet on the server then I found out that the server that
    >>this needs to work with doesn't support servlets or Tomcat. The server
    >>supports PHP and CGI and the hosting company does not want to add java
    >>support.
    >>Can anyone give me an idea on how to go about this?
    >>
    >>David Miller
    >>
    >>
    >>

    >
    >Depending upon what you mean by "access", it is possible to do the above
    >without even using an applet. Simply have a URL which specifies the name of
    >the directory you wish to access.
    >
    >Something like http://server/list/directory_name
    >
    >On the server side, either via PHP or CGI, parse the URL for the command
    >"list", and the directory name "directory_name", return an HTML response
    >which has the list of the files in the directory in a list box.
    >
    >Handle the submission from the client of a selected file, and provide as a
    >response whatever constitutes "access" to it.
    >
    >Of course, you may want to get fancy in your output and selection, but that
    >is the gist of it. Of course, other solutions are possible.
    >
    >HTH,
    >
    >
    >
    >

    Ok I have that, I have PHP that I can make a request and get back a
    list of files, etc. but now I have this applet that I need to parse data
    from the selected file and display specific info in the applet frame. I
    have the bulk of the applet working now.
    Does servlets use http to communicate with applets?
    If yes, is there a special header that is needed in the response? I can
    make my applet send a post or get to my PHP to generate a response but
    what goes in this response to tell my browser that it isn't a new page
    to be displayed but data to be sent to the applet?

    David
    James David Miller, Nov 3, 2003
    #3
  4. James David Miller wrote:
    > I have a javaApplet that needs to access a directory on the server, list
    > the files in directory, then access the selected file. My first idea
    > was to use a servlet on the server then I found out that the server that
    > this needs to work with doesn't support servlets or Tomcat. The server
    > supports PHP and CGI and the hosting company does not want to add java
    > support.
    > Can anyone give me an idea on how to go about this?


    Should be easy enough to write PHP or other CGI script to do the directory
    listing.

    Actually, you might not even need that. If the web server has directory
    listings activated (or lets you activate them) then you could request
    the directory URL and parse the output within the applet.
    Michael Borgwardt, Nov 3, 2003
    #4
  5. > Does servlets use http to communicate with applets?

    It's your choice, really.

    > If yes, is there a special header that is needed in the response? I can
    > make my applet send a post or get to my PHP to generate a response but
    > what goes in this response to tell my browser that it isn't a new page
    > to be displayed but data to be sent to the applet?


    If you do the HTML request within the applet code, the web browser
    doesn't get involved at all.
    Michael Borgwardt, Nov 3, 2003
    #5
  6. James David Miller

    tiger10112 Guest

    Michael Borgwardt <> wrote in message news:<bo5ar1$17e6bt$-berlin.de>...
    > James David Miller wrote:
    > > I have a javaApplet that needs to access a directory on the server, list
    > > the files in directory, then access the selected file. My first idea
    > > was to use a servlet on the server then I found out that the server that
    > > this needs to work with doesn't support servlets or Tomcat. The server
    > > supports PHP and CGI and the hosting company does not want to add java
    > > support.
    > > Can anyone give me an idea on how to go about this?

    >
    > Should be easy enough to write PHP or other CGI script to do the directory
    > listing.
    >
    > Actually, you might not even need that. If the web server has directory
    > listings activated (or lets you activate them) then you could request
    > the directory URL and parse the output within the applet.


    Thats it !!
    tiger10112, Nov 3, 2003
    #6
    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. Mark Kamoski
    Replies:
    7
    Views:
    8,608
    Mark Kamoski
    Aug 9, 2003
  2. kamig
    Replies:
    1
    Views:
    456
    =?Utf-8?B?cmFq?=
    Mar 17, 2006
  3. Ulf Meinhardt
    Replies:
    0
    Views:
    398
    Ulf Meinhardt
    Nov 11, 2004
  4. -
    Replies:
    2
    Views:
    378
    Alan Krueger
    Jul 29, 2005
  5. JC
    Replies:
    3
    Views:
    563
    =?ISO-8859-2?Q?Dra=BEen_Gemi=E6?=
    Jun 19, 2006
Loading...

Share This Page