Link to home
Start Free TrialLog in
Avatar of blairdye
blairdye

asked on

Running a Servlet as .exe or .dll

I noticed a feature in Visual Age that allows the compilation of platform independant bytecode code into platform specific code.
Is it possible to do this with servlets? So my servlet and associated beans run as .exe or .dll?
How would i go about fitting the resulting *.exe into my App Server?
thanks
Blair
Avatar of techtime
techtime

As far as I remember this technology they use in VA emerged from HPJC (High Performance Java Compiler) that originally was designed exactly for that purpose you talk about.
So you write in java compile it into platform specific code and get a common CGI like application. And you treaty it just like CGI...
> Is it possible to do this with servlets?

you can.
but you'd better not. after all servlets are designed to be web server extensions.
Avatar of blairdye

ASKER

>So you write in java compile it into platform >specific code and get a common CGI like >application. And you treaty it just like CGI...

so i compile a servlet and its related beans into a .exe... and then? How do I run it like a CGI?
> ... and then?

and then - nothing
you have to WRITE a CGI (CGI is common gateway interface) - servlets ARE NOT CGI SCRIPTS - they are CGI replacement.
ASKER CERTIFIED SOLUTION
Avatar of techtime
techtime

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
no need to go over all that has been already said here but think about it this way.

Currently your Web Server calls the doGet and doPost methods that you have over ridden in your servlet in response to a HTTP GET and POST request,
The server also provides the Request and Response context objects that you use to respond to the client.

Suppose you do create an exe from a servlet....how then do you expect to
handle all this??

BOTTOM LINE....refer to techtime's comment!!.

>> 2) You still _can_ use VA java to make CGI scripts.

as I already said :)
'you can.
but you'd better not.'

btw. it won't be easy, because CGI scripts rely on environment variables and
(class System) public static String getenv(String name) is deprecated in Java 1.1 (and it does NOT work)