Java application with web interaction

B

B@za

Hi

I'm moving into an area of Java in which I am unfamiliar and I wondered if
somebody here could point me in the right direction. I am producing an
message classifier for a technical support department using machine
learning. I have written a prototype classifier already and it is
classifying test messages with a reasonable degree of accuracy. However at
this stage, I now need to think about integration with a web site.
Customers will submit queries via a web form which will then be fed to the
classifier before being redirected to an appropriate department for
handling. It's the integration between the web form and the classifier
application that is a bit of a problem.

My classifier is a standard Java application, nothing special in it's
operation. The web site will run off an Apache server and the form will be
a standard web form. What's the best way to channel the output of the form
into my Java application. I have thought of the following possibilities, I
don't know which one is best, or even if some of them are practical.

* The use of servlets and RMI to transfer the data from a servlet to a
Java application based elsewhere.

* Linking the servlet and application into one program. This will mean
however that the application will need to run on a web server. I'm not
sure if this is possible

* Using a servlet to write the entry to a file which is re-read later by
the Java application and added to a queue.

* Using CGI. This is an academic project and performance is not a big
issue at this stage. The method used would probably be similar to the
previous point

Does anybody know which of the following ways would be best? Is there a
better way which I've missed?

Thanks
 
C

Christophe Vanfleteren

B@za said:
Hi

I'm moving into an area of Java in which I am unfamiliar and I wondered if
somebody here could point me in the right direction. I am producing an
message classifier for a technical support department using machine
learning. I have written a prototype classifier already and it is
classifying test messages with a reasonable degree of accuracy. However at
this stage, I now need to think about integration with a web site.
Customers will submit queries via a web form which will then be fed to the
classifier before being redirected to an appropriate department for
handling. It's the integration between the web form and the classifier
application that is a bit of a problem.

My classifier is a standard Java application, nothing special in it's
operation. The web site will run off an Apache server and the form will be
a standard web form. What's the best way to channel the output of the form
into my Java application. I have thought of the following possibilities, I
don't know which one is best, or even if some of them are practical.

* The use of servlets and RMI to transfer the data from a servlet to a
Java application based elsewhere.

* Linking the servlet and application into one program. This will mean
however that the application will need to run on a web server. I'm not
sure if this is possible

If your application is well written (seperate layers of functionality, ...),
you should be able to use it as a library in a Servlet you create. This
wouldn't mean that your application itself would become dependent on the
Servlet api however.
 
M

Michael Borgwardt

B@za said:
* The use of servlets and RMI to transfer the data from a servlet to a
Java application based elsewhere.

Could be done and would work, but is probably unnecessarily complex.
* Linking the servlet and application into one program. This will mean
however that the application will need to run on a web server. I'm not
sure if this is possible

I see no problem with this.
* Using a servlet to write the entry to a file which is re-read later by
the Java application and added to a queue.

Very bad idea. You get into lots of issues with concurrent file access.
* Using CGI. This is an academic project and performance is not a big
issue at this stage. The method used would probably be similar to the
previous point

I don't see how this would solve the problem.
 
J

JavaJunkie

My suggestion is to buy the book "Professional JSP" by Wrox and read it from
start to finish.

JSP is your answer. Don't complicate your life! You have a java class with
methods, just execute them from a JSP page!
 
B

B@za

Hi

Could be done and would work, but is probably unnecessarily complex.


I see no problem with this.

Just out of interest, how would this be done? I don't know very much about
servlets, but I assume an object will be created by user action posting
the request. The application would already be running and the page would
send the form output to the main application via an interface (to a method
in the application)?
Very bad idea. You get into lots of issues with concurrent file access.

I agree, I really didn't fancy this approach. I'm glad the earlier ones
work.

Thanks
 
B

B@za

Hi

My suggestion is to buy the book "Professional JSP" by Wrox and read it from
start to finish.

JSP is your answer. Don't complicate your life! You have a java class with
methods, just execute them from a JSP page!

That sounds like a more simple approach. Is it worth buying a book though
just to produce one JSP page to pass information to the Java application?

Thanks
 
M

Michael Borgwardt

B@za said:
Just out of interest, how would this be done? I don't know very much about
servlets, but I assume an object will be created by user action posting
the request. The application would already be running and the page would
send the form output to the main application via an interface (to a method
in the application)?

Why would the application already be running? As Christophe wrote: the
servlet should be able to use the application like a function library,
i.e. it receives
the form data, uses the classifier's classes and methods to process
it,
forwards the request to the appropriate department and tells the user
about it.
 

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

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,209
Latest member
NelsonJax

Latest Threads

Top