Integrating servlet container into my stand alone App

D

DiscoStu

Hello Everyone,

I had this idea for an application I would like to write. I want
to write it as a java application, but be able to output
program-generated .html into an Internet Explorer window. Sending the
generated html to the IE window is easy... just using the Runtime
class. But I want the Internet Explorer window to be able to make http
calls back to my application for form submissions. I didn't want to
have to force my users to install Tomcat just so the internet explorer
could pass back information to the servlet in my .Jar file.

How hard is it to add a servlet container and respond to http post's
from the localhost internet explorer window? This is all from my .jar
file and not from a web application running under tomcat remember. The
only http requests coming into my application will be from that one
internet explorer window... so its really acting like a
single-user-local-machine Tomcat server. But I dont want the burden of
forcing Tomcat on people.

I suppose you'll say pick a standard application or a jsp/servlet
solution, but not both.... but I think there is a lot of flexability
to this method, being able to generate GUI screens on the fly in the
IE window is really exciting.

Thanks,

Greg
 
S

Silvio Bierman

DiscoStu said:
Hello Everyone,

I had this idea for an application I would like to write. I want
to write it as a java application, but be able to output
program-generated .html into an Internet Explorer window. Sending the
generated html to the IE window is easy... just using the Runtime
class. But I want the Internet Explorer window to be able to make http
calls back to my application for form submissions. I didn't want to
have to force my users to install Tomcat just so the internet explorer
could pass back information to the servlet in my .Jar file.

How hard is it to add a servlet container and respond to http post's
from the localhost internet explorer window? This is all from my .jar
file and not from a web application running under tomcat remember. The
only http requests coming into my application will be from that one
internet explorer window... so its really acting like a
single-user-local-machine Tomcat server. But I dont want the burden of
forcing Tomcat on people.

I suppose you'll say pick a standard application or a jsp/servlet
solution, but not both.... but I think there is a lot of flexability
to this method, being able to generate GUI screens on the fly in the
IE window is really exciting.

Thanks,

Greg

Greg,

My company supplies a software system that is basically based on standard
servlets but since most of our potential customers do not own or want to own
a J2EE server environment we normally distribute our servlets packages with
a servlet container that can be simply embedded in a Java app (of no more
then a few lines). In short, people only install a JRE, unpack our ZIP and
fire up the app. For windows environments we cooked up a service wrapper EXE
and that is it.

Actually, our system consists of a central server that has no user
interfaces but handles XML requests through HTTP (servlets handle the
requests through the servlet container) which come from multiple application
servers (servlets that generate HTML as the UI and connect to the central
server via HTTP requests). Both tiers are servlet based and use the same
setup.

The embeddable server is Jetty (www.mortbay.org) which is one of the best
(free) servlet containers available and very simple to embed (including
sample code and great free support through the mailing lists).
 
D

DiscoStu

The embeddable server is Jetty (www.mortbay.org) which is one of the best
(free) servlet containers available and very simple to embed (including
sample code and great free support through the mailing lists).


That sounds exactly like what I need. Thanks for pointing it out.
 
B

Bryce

Hello Everyone,

I had this idea for an application I would like to write. I want
to write it as a java application, but be able to output
program-generated .html into an Internet Explorer window. Sending the
generated html to the IE window is easy... just using the Runtime
class. But I want the Internet Explorer window to be able to make http
calls back to my application for form submissions. I didn't want to
have to force my users to install Tomcat just so the internet explorer
could pass back information to the servlet in my .Jar file.

How hard is it to add a servlet container and respond to http post's
from the localhost internet explorer window? This is all from my .jar
file and not from a web application running under tomcat remember. The
only http requests coming into my application will be from that one
internet explorer window... so its really acting like a
single-user-local-machine Tomcat server. But I dont want the burden of
forcing Tomcat on people.

I suppose you'll say pick a standard application or a jsp/servlet
solution, but not both.... but I think there is a lot of flexability
to this method, being able to generate GUI screens on the fly in the
IE window is really exciting.

Check out Jetty. Very easy to integrate.

http://www.mortbay.org/jetty/index.html

I've used it many times. For a while, it was the servlet container
that JBoss used by default. I believe its the one that Apache Geronimo
uses now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top