tags:

views:

336

answers:

2

I want to create chat application using Servlets & JSP. May I know how can I create chat application as I have never created before?

How much knowledge I need to have to create chat application?

Is there any need of networking API to create chat application?

What's the design pattern I need to follow to create that application?

Is there any need of database?

+2  A: 

Its already done here Chat Servlet

S.Mark
+1  A: 

How much knowledge I need to have to create chat application?

At least basic HTTP (RFC2616), Java, JSP and Servlets.

The remnant depends on the technical design. How do you want to serve it? As an Applet? Then basic knowledge of Swing and Applets is mandatory as well. Or do you want to serve it in a plain webpage and make use of ajaxical powers? Then basic knowledge of HTML, CSS, JS, HTML DOM and Ajax is mandatory as well.

Is there any need of networking API to create chat application?

HTTP is more than sufficient. When you're developing it as an applet, use java.net.URLConnection to connect with the servlet (you can find here several hints how to use it). When you're developing it as ajax webpage, use XMLHttpRequest to connect with the servlet (or less bloated and better, jQuery).

What's the design pattern I need to follow to create that application?

Nothing specifically, actually. The Servlet API has already covered most for you under the hoods. Just respond on HTTP requests accordingly. You'll only keep in mind that HTTP is a pull protocol, not a push protocol. If you want to be able to push data from server to the client, then have a look at Comet (which is however a completely different subject at its own, not sure if that fits in your project), else you'll just have to fire client-server polls at timed intervals.

Is there any need of database?

Only if you want to store the data for a longer time than the application lives.

If you rather intend to use a 3rd party one than developing at your own, have a look here for an overview of all Java based open source chat servers.

BalusC