users@glassfish.java.net

Re: Interrupting a running Servlet

From: <glassfish_at_javadesktop.org>
Date: Wed, 02 Apr 2008 05:08:08 PST

Hi!

First of all, thank you guys for your help. I realize this isn't an easy task and the one way we thought of to get around this was to simply put a file on the server which the C process is looking for. Quite dirty, I know.

The thing with the seperate C service looks very nice. Since I'm not that much of a JavaEE guy here's another problem: How do I dispatch HttpServletRequests from inside a client application? Up until now I have always invoked the servlet by calling the URL specified in the servlets url mapping. I want to be able to simply click a on button representing the corresponding function in the C DLL/SO.

I've checked in the API reference and looked at all the classes but so far I can't see how to get a hold of the necessary objects. Ok, connecting to an http server isn't that big a deal with the URL class but how to retrieve a ServletContext? I assume I'll especially need that class to get things going, correct?

Here's my current plan:

1. Establish a connection to the webserver

2. Invoke the servlet with a request indicating to start the C process manager
and retrieve the ServletContext so I can send further requests.

3. Get the interger value returned by the C methods back to the application via a ServletResponse when all stuff is done

Well, I might need a bit of help with this. :)

Thanks so much for your input so far!

- Thomas
[Message sent by forum member 'stylertim' (stylertim)]

http://forums.java.net/jive/thread.jspa?messageID=267292