Hi, I'm a servlet newbie and thought they might be a solution to my problem, but now I wonder.
I want to run a Big Ol' Number Cruncher (BONC) on a server. From my Java client (NOT a web browser) I want to submit a job over the network and have the BONC run it. Currently I do this locally, which ties up the client machine.
If a servlet does this, can the servlet, at the client's request, then send the BONC's zipped output file back to the client? (The unzipped output may be hundreds of MB). Searches of the web and O'Reilly's "Servlet Programming" have not indicated that this is possible.
Are servlets too brain dead to do this sort of thing? I would prefer not to run a web server on the BONC server. Should I be looking at a different technology (Globus Toolkit seems like overkill)? Surely this has been done before.
I think I'll have to learn what this HTTPResponse business is.
I think this is a brillant idea when working with Servlets.
Joined: Dec 07, 2001
Thanks much to all who responded. I get the feeling that Tomcat actually might do the job. I installed 5.5.9 and browsed to the default page. Next I'll see if I can write a Java client to contact Tomcat, and then see if I can send a servlet something and get a response.
The more fundamental question is how to upload input files for the BONC and download output files.
As far as compression goes, in my new installation I found that in
there is Java code which seems to send a compressed Stream via an HttpServletResponse. I don't know why this code is there.
Joined: Dec 07, 2001
I thought I'd add some code to this thread. First, there is a servlet with doPost() and doGet() methods. Then there is a Java client which connects to the servlet and calls one method or the other, depending on the value of DO_POST. The doPost() method will read a Stream from the client, and write one back. Presumably this will work for uploading and downloading files; note the API has different streams for binary files. Also of interest is this link for a tool which might simplify uploading.
Note the doGet() is based on the Tomcat 5.5.9 sample.war. I repeat that I am a newbie at this. If you go to this servlet with a browser, the doGet() is invoked. I couldn't find the distinction in the spec. [ June 17, 2005: Message edited by: Glenn Murray ]