?
Solved

Running a Servlet as .exe or .dll

Posted on 2000-02-11
7
Medium Priority
?
215 Views
Last Modified: 2013-11-24
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
0
Comment
Question by:blairdye
7 Comments
 
LVL 1

Expert Comment

by:techtime
ID: 2511766
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...
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2514204
> 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.
0
 

Author Comment

by:blairdye
ID: 2517958
>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?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 16

Expert Comment

by:heyhey_
ID: 2518036
> ... 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.
0
 
LVL 1

Accepted Solution

by:
techtime earned 300 total points
ID: 2518121
Well, first heyhey is definately right saying that "servlets" are not CGI scripts. They implement a Servlet interface and server uses its methods to get and post data to servlet. When you speak about compiled (.exe) code you can call it from your html as usual but it is not going to be a servlet anymore in a sense that the server won't use those sevlet methods to communicate with your code. I beleive standard input/output streams will be used.
So to summarize: 1) You _cannot_ make you _servlet_ as an .exe file
2) You still _can_ use VA java to make CGI scripts.
0
 
LVL 1

Expert Comment

by:rainmal
ID: 2518200
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!!.

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2518225
>> 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)
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month3 days, 10 hours left to enroll

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question