Re: Integrating servlet container into my stand alone App

From: Silvio Bierman (sbierman_at_idfix.nl)
Date: 09/26/04


Date: Sun, 26 Sep 2004 02:20:16 +0200


"DiscoStu" <gregfrommer@hotmail.com> wrote in message
news:8457f9da.0409251042.61fb069a@posting.google.com...
> 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).



Relevant Pages

  • Re: Http POST requests changed to GET by proxy?
    ... between the applet and the servlet engine. ... When our applet creates a HTTP connection to the server it uses ... unknown and creates an HTTP GET request, thus doGet will be called on ...
    (comp.lang.java.programmer)
  • Re: J2ME / J2EE Communication
    ... > notified by EE server when theres a event going ... > Servlet, which is a server-passivate. ... Why don't you think you can do it with HTTP? ... How long do you expect to go between data events? ...
    (comp.lang.java.programmer)
  • Forward HTTPrequest to Servlet to an Object
    ... server, well therefore i have got a servlet which should have different ... Request and the output is also a HTTP Response. ... the incoming HTTP Request to my Servlet to the Application which I instanted ...
    (comp.lang.java.help)
  • Re: HTTP Security Question
    ... > I have a single server/multiple client application where the clients are ... > it and I intend to SEND messages from the server to the client via HTTP ... > requests to the servlet. ... how will Your server know whom to send SENDs to? ...
    (comp.os.linux.security)
  • Application in Java Servlet
    ... server, well therefore i have got a servlet which should have different ... Request and the output is also a HTTP Response. ... the incoming HTTP Request to my Servlet to the Application which I instanted ...
    (comp.lang.java.programmer)