What I need?

A

Ajgor

Hello.

I am a quite newbie in Java.
I would like to do a little communicator like aplication (not applet). I
have to do a server, and client.
It has to be only little java programming exercise. I use an Eclipse IDE.
And I would like to ask a little question. What do I have to use?
J2EE? EJB? Wchich server?
 
R

Roedy Green

I am a quite newbie in Java.
I would like to do a little communicator like aplication (not applet). I
have to do a server, and client.
It has to be only little java programming exercise. I use an Eclipse IDE.
And I would like to ask a little question. What do I have to use?
J2EE? EJB? Wchich server?

see http://mindprod.com/jgloss/gettingstarted.html

To make this as simple as possible, write your client as either an
application or a Java WebStart.

http://mindprod.com/jgloss/javawebstart.html

Write your server as a Servlet and put it in a TomCat Womb.
http://mindprod.com/jgloss/servlet.html


Forget about J2EE, EBJ and even JSP for now. You don't want to
overwhelm yourself. You must walk before you can run.

You might have to use SQL. See http://mindprod.com/jgloss/sql.html
Most likely vendors are MySQL, PostGres and Derby.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Here is a point of no return after which warming becomes unstoppable
and we are probably going to sail right through it.
It is the point at which anthropogenic (human-caused) warming triggers
huge releases of carbon dioxide from warming oceans, or similar releases
of both carbon dioxide and methane from melting permafrost, or both.
Most climate scientists think that point lies not far beyond 2°C (4°F) C hotter."
~ Gwynne Dyer
 
T

Tom Anderson

Write your server as a Servlet and put it in a TomCat Womb.

ICK! Also, i'm not sure thta a womb is a good metaphor - wombs ultimately
give birth. I don't want my servlet container to give birth.

tom
 
M

Martin Gregorie

Hello.

I am a quite newbie in Java.
I would like to do a little communicator like aplication (not applet). I
have to do a server, and client.
It has to be only little java programming exercise. I use an Eclipse
IDE. And I would like to ask a little question. What do I have to use?
J2EE? EJB? Wchich server?
The simplest approach is to write both as plain J2SE command line
programs.

The server listens for connections on a ServerSocket and, when it gets
one, starts a thread that reads input and writes responses on the Socket
returned by Accept until the client closes the connection. At this point
the thread terminates. A simple server needs no i/o unless its outputting
debugging information to System.err

The client uses a Socket to send data to the server, reads responses and
ends the session by closing its Socket. You can accept input from
System.in or command line arguments and write responses to System.out.

That's it. All the information you need to do this is in the standard JDK
documentation set. See the class definitions and tutorials.
 
A

Ajgor

Uzytkownik "Tom Anderson" napisal w wiadomosci
ICK! Also, i'm not sure thta a womb is a good metaphor - wombs ultimately
give birth. I don't want my servlet container to give birth.

ROTFL :)

Thank You all for answers. I think, they are very useful, and helpful.
 
A

Arne Vajhøj

Martin said:
The simplest approach is to write both as plain J2SE command line
programs.

The server listens for connections on a ServerSocket and, when it gets
one, starts a thread that reads input and writes responses on the Socket
returned by Accept until the client closes the connection. At this point
the thread terminates. A simple server needs no i/o unless its outputting
debugging information to System.err

The client uses a Socket to send data to the server, reads responses and
ends the session by closing its Socket. You can accept input from
System.in or command line arguments and write responses to System.out.

Using UDP instead of TCP was also a possibility.

But this is a good example of how the simple solution is actually
a very good solution.

Arne
 
A

Arne Vajhøj

Roedy said:
see http://mindprod.com/jgloss/gettingstarted.html

To make this as simple as possible, write your client as either an
application or a Java WebStart.

http://mindprod.com/jgloss/javawebstart.html

Write your server as a Servlet and put it in a TomCat Womb.
http://mindprod.com/jgloss/servlet.html

Servlet means HTTP which means poll instead of push.

Usually a very bad choice for chat style apps.
Forget about J2EE, EBJ and even JSP for now. You don't want to
overwhelm yourself. You must walk before you can run.

Servlets are Java EE (once known as J2EE).
You might have to use SQL. See http://mindprod.com/jgloss/sql.html
Most likely vendors are MySQL, PostGres and Derby.

It is 3 databases.

It is not obvious that they are more likely than many
other options (HSQLSB, FireBird, MS SQLServer Express, Oracle XE,
IBM DB2 Express-C etc.).

Arne
 
A

Arved Sandstrom

Using UDP instead of TCP was also a possibility.

But this is a good example of how the simple solution is actually a very
good solution.

Arne

I'd also recommend this solution because it teaches some core I/O
concepts, whereas using J2EE teaches you about...well, J2EE APIs. Writing
a little socket server not only is a good intro to Java network
programming, it's also a good way of gradually introducing the
concurrency classes/interfaces, and thinking about threading issues in
general.

AHS
 

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,792
Messages
2,569,639
Members
45,351
Latest member
RoxiePulli

Latest Threads

Top