Advice on web app

J

Jozza

I have to develop a web application on Tomcat as following:
-a service application that would be a tcp server accepting connections to
receive data and store it into a database.
-a user application that would display collected data from that database in
the browser.

The best thing for a server application would be to start-up with Tomcat, so
what type of application should it be?
(from which class should it descend)
And for user application, should it be a http servlet?
I'm using Eclipse IDE. I am new to Tomcat and java web development so my
decision making ability for project architecture is very poor.

J.
 
J

John B. Matthews

I have to develop a web application on Tomcat as following: -a
service application that would be a tcp server accepting connections
to receive data and store it into a database. -a user application
that would display collected data from that database in the browser.

The best thing for a server application would be to start-up with
Tomcat, so what type of application should it be? (from which class
should it descend)

Servlets extend HttpServlet, implementing one or more of its methods to
handle an HttpServletRequest:

<http://java.sun.com/webservices/docs/1.6/api/javax/servlet/http/HttpServ
let.html>
<http://java.sun.com/webservices/docs/1.6/api/javax/servlet/http/HttpServ
letRequest.html>
And for user application, should it be a http servlet? I'm using
Eclipse IDE. I am new to Tomcat and java web development so my
decision making ability for project architecture is very poor.

You should consider a tutorial, such as one of these:

<http://courses.coreservlets.com/>

A book like Marty Hall's is essential:

<http://volume1.coreservlets.com/>
 
A

Arved Sandstrom

Jozza said:
I have to develop a web application on Tomcat as following:
-a service application that would be a tcp server accepting connections to
receive data and store it into a database.
-a user application that would display collected data from that database
in the browser.

The best thing for a server application would be to start-up with Tomcat,
so what type of application should it be?
(from which class should it descend)
And for user application, should it be a http servlet?
I'm using Eclipse IDE. I am new to Tomcat and java web development so my
decision making ability for project architecture is very poor.

J.

Let's say that you don't use a framework at all (if you did, a framework
would simply substitute for all or some of the main pieces in the following
simple picture). Hewing reasonably closely to a simple model-view-controller
architecture (MVC), you'd have a main servlet that acts as your controller,
decides what to do with requests based on your business logic, delegates the
processing (like fetching data from the database) to the model (plain
classes that have the business logic and data access code), and finally
selects a view (the view obtains required data from the model).

The servlet running on Tomcat, with all the supporting model classes, *is*
your server application. To the extent that you have a user application at
all, in the absence of a rich Internet client, it is the different web pages
that you deliver to the browser - HTML/XHTML, CSS, JavaScript etc.

In addition to John's recommendations, you may wish to also read
http://java.sun.com/blueprints/patterns/MVC-detailed.html

AHS
 
J

Jozza

Jozza said:
I have to develop a web application on Tomcat as following:
-a service application that would be a tcp server accepting connections to
receive data and store it into a database.
-a user application that would display collected data from that database
in the browser.

The best thing for a server application would be to start-up with Tomcat,
so what type of application should it be?
(from which class should it descend)
And for user application, should it be a http servlet?
I'm using Eclipse IDE. I am new to Tomcat and java web development so my
decision making ability for project architecture is very poor.

J.

Thanks for the great pointers, especially the MVC one :)

J.
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top