01-26-2009
It depends on how you want users to chat. Implementing a (1) 100% Web-based chatroom (no applet), or (2) users use applet from a Web page to chat? Or (3) users have dedicated clients (e.g. swing GUI) for chat?
I hope this is not college assignment. We don't allow posting these kind of questions here. But I will not post any code anyway as they are not something you can do with just a few lines of code and you should try to explore on your own.
(3) The GUI client can support any client-server socket protocol so this is the most traditional way to do this
(2) An applet can have limited networking capability so you can mostly use your own protocol as in case (3)
(1) Without applet, immediate refresh of message on Web page may be triggered by AJAX. You can use Tomcat (or even application server such as JBoss) to host an application server with state managed on it. However, to avoid excessive AJAX polling, you can use Jetty instead of Tomcat, that supports "continuations" so that it can push update to client instead of requiring polling from client side. Actually, the Jetty distribution has an example that exactly demonstrates how to create a chatroom using this method.
10 More Discussions You Might Find Interesting
1. Linux
hey there
we cant seem to get jsp to load pages properly on linux running tomcat 4 server. everytime we run .jsp files, the source code comes up instead of the actual file contents. any suggestions??
cheers
mile1982 (1 Reply)
Discussion started by: mile1982
1 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
I Installed Tomcat in an remote linux server (/usr/tomcat)and start service, using ./startup.sh (and tried with ./catalina.sh too).
//----------------------------------------------------------------//
# ./startup.sh
Using CATALINA_BASE: /usr/tomcat/apache-tomcat-6.0.16/
Using... (1 Reply)
Discussion started by: gothama
1 Replies
3. Shell Programming and Scripting
hi,
I need a command that restart the tomcat server.
for example for restart the tomcat i am using following command, /etc/init.d/tomcat restart ..but sometimes is not working...might be i want to use java code access this peace of script.
like using the grep and ps commands can i use?... (2 Replies)
Discussion started by: sankar reddy
2 Replies
4. Shell Programming and Scripting
Hello all,
I am working on a script to automate the process of restarting some tomcat servers. The versions of tomcat are pretty old and it often happens that they don't shut down gracefully and the PID needs to be manually killed. I am having a bear of a time getting a consistent PID from ps... (1 Reply)
Discussion started by: dkaplowitz
1 Replies
5. Programming
Hi,
I have installed
following software on my linux machine.
Is there anything else required to run jsp pages on linux machine?
Please Help
Here are some details that might be helpful.
# lsb_release -a
LSB Version: ... (3 Replies)
Discussion started by: pinga123
3 Replies
6. Shell Programming and Scripting
Hello everyone,
I have a small expect script as follows;
#!/usr/bin/expect -f
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg}... (1 Reply)
Discussion started by: randeel
1 Replies
7. Solaris
Hi,
We have upgrade tomcat from 5.0.20 to 7.0.33 and made changes to server.xml file according to newer version.. how ever the upgrade went fine and now i am unable to deploy application remotely.. it is giving 403 access denied error.. we have seperate appbase directory mentioned in server.xml..... (0 Replies)
Discussion started by: phani4u
0 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I'm trying to figure out the best location to deploy an application on Tomcat over Linux server.
The application structure is as follows:
1. WAR - the app itself.
2. conf - configuration files that are part of the product, not to be changed in deployment
3. local_conf - overriding... (0 Replies)
Discussion started by: moshebs
0 Replies
9. UNIX and Linux Applications
Tomcat stops logging intermittently for brief intervals of time like for 5 or 6 secs
I wish to monitor if my Tomcat process gets stuck, hung or even shutdown or remains healthy at the time i see the problem of no logging.
Can you please let me know how can i monitor Tomcat Application... (10 Replies)
Discussion started by: mohtashims
10 Replies
10. UNIX for Advanced & Expert Users
Hi,
I have been assigned a task to build a server with these requirements :
> has multiple tomcats running under the same apache.
> tomcat & jdk has to be binded with apache.
> latest openssl with all necesarry "mod" to bind with apache & tomcat.
I am fairly new to... (1 Reply)
Discussion started by: anaigini45
1 Replies
LEARN ABOUT OSX
chatwidget
chatwidget(n) Composite widget for chat applications chatwidget(n)
__________________________________________________________________________________________________________________________________________________
NAME
chatwidget - Provides a multi-paned view suitable for display of chat room or irc channel information
SYNOPSIS
package require Tk 8.5
package require chatwidget ?1.0.0?
::chatwidget::chatwidget path ?options?
$widget topic command args
$widget name nick args
$widget message text args
$widget hook command args
$widget names args
$widget entry args
$widget chat args
_________________________________________________________________
DESCRIPTION
This is a composite widget designed to simplify the construction of chat applications. The widget contains display areas for chat messages,
user names and topic and an entry area. It automatically handles colourization of messages per nick and manages nick completion. A system
of hooks permit the application author to adjust display features. The main chat display area may be split for use displaying history or
for searching.
The widget is made up of a number of text widget and panedwindow widgets so that the size of each part of the display may be adjusted by
the user. All the text widgets may be accessed via widget passthrough commands if fine adjustment is required. The topic and names sections
can also be hidden if desired.
COMMANDS
::chatwidget::chatwidget path ?options?
Create a new chatwidget using the Tk window id path. Any options provided are currently passed directly to the main chat text wid-
get.
WIDGET COMMANDS
$widget topic command args
The chat widget can display a topic string, for instance the topic or name given to a multi-user chatroom or irc channel.
show Enable display of the topic.
hide Disable display of the topic
set topic
Set the topic text to topic.
$widget name nick args
Control the names and tags associated with names.
list ?-full?
Returns a list of all the user names from the names view. If ?-full? is given then the list returned is a list of lists where
each sublist is made up of the nick followed by any options that have been set on this nick entry. This may be used to exam-
ine any application specific options that may be applied to a nick when using the add command.
add nick ?options?
delete nick
$widget message text args
Add messages to the display. options are -nick, -time, -type, -mark -tags
$widget hook command args
Manage hooks. add (message, post names_group, names_nick, chatstate), remove, run
$widget names args
Passthrough to the name display text widget. See the text widget manual for all available commands. The chatwidget provides two
additional commands show and hide which are used to control the display of this element in the widget.
$widget entry args
Passthrough to the entry text widget. See the text widget manual for all available commands.
$widget chat args
Passthrough to the chat text widget. See the text widget manual for all available commands.
EXAMPLE
chatwidget::chatwidget .chat
proc speak {w msg} {$w message $msg -nick user}
pack .chat -side top -fill both -expand 1
A more extensive example is available by examining the code for the picoirc program in the tclapps repository which ties the tcllib picoirc
package to this chatwidget package to create a simple irc client.
SEE ALSO
text(n)
KEYWORDS
chat, chatwidget, composite widget, irc, mega-widget, widget
chatwidget 1.0.0 chatwidget(n)