JavaZOOM Web Site
Applets !
Open projects
About JavaZOOM

Multiple Ads System
J-Ads 2.1 Applet

Any Question ?
Try our Forums !

java chat

Here is the jzChat V1.0 servlet (free). This servlet performs a 100% HTML/JavaScript chatroom. Guest users just have to enter a nickname for chatting. They can choose chat's look&feel. Private messages are allowed. Root user chooses chatroom's name and subject. Root also controls the chatroom : max. users, open, close, transcript, list or kickoff users, clear blacklist features are available. jzChat is protected against cross scripting attacks. Only root user could use "direct-HTML". Note that this chat could run in both framed and non-framed mode.

 How to install jzChat ? How to setup parameters ?  How to customize jzChat ?  F.A.Q

How to install jzChat

Download the package v1.12 here (39.9 KB - zip file).

To install jzChat, your WebServer or ISP has to support JAVA SERVLETS (note that servlets support is not CGI support). Click here to get a list. Some are free.

The package is built as follows :

This directory contains all class files needed to run jzChat :

  • jzchat.class (the servlet)
  • jzchat.initArgs (servlet init parameter file, Jserv/JavaWebServer only)
  • jzChat/*.class (core)
  • jzChat/Util/*.class (core)

This directory contains all files needed for jzChat configuration and customization :

  • jzchat.conf (chat configuration file)
  • adminlogin.jsp (root login web page)
  • openchatroom.jsp (root chatroom opening web page)
  • viewchatroom.jsp (root chatroom management web page)
  • chatlogin.jsp (guest login web page)
  • chatroomjs.jsp (chat web page)

The servlet/ directory should be placed under the servlet directory of the web server (servlets/ or servlet/ as usually). The web/ directory could be (and should be) placed outside the web root. Then you have to setup config parameter through init parameters of your servlet engine. Fill in it with jzchat.conf file (absolute path needed). If you're using JSERV servlet engine then edit jzchat.initArgs to do so.

How to setup parameters ?

Edit jzchat.conf from web/ directory change parameters if needed. Pay attention to parameters in red :

    This parameter defines the absolute path for stored files (log files, backup file and transcript file). Here are some examples :
    STOREPATH = /usr/local/apache/wwwroot/logs (unix os)
    STOREPATH = c:\Apache\JServ\web (win32 os)
    Use this parameter to setup chatroom backup filename. It's a binary file saved at regular intervals. It's also used to restore chatroom after a servlet engine halt or crash.
    Use this parameter to setup chatroom transcript. It's a text file with the whole chat.
    URI to the jzchat servlet (/servlet/jzchat or /servets/jzchat as usually).
  • HOSTURL <== deprecated since v1.10: HOSTURL parameter followed by SERVLET parameter must be the absolute URL of the jzChat. (e.g. HOSTURL=http://127.0.01:8080)
    This parameter defines the absolute path for JSP files (i.e. web/).
    This parameter is linked with the two parameters below. It allows to define whether or not you use buffered-frame mode. Values could be YES or NO.
    jzChat provides three displaying mode :
    - Non-Framed mode (no frames)
    - Framed mode (two frames for a more convenient usage)
    - Buffered-Framed mode (three frames to avoid flickering effect)

    Default mode is buffered-framed one.
  • CHAT :
    Chat web page (dynamic-content). This page is sent back to end user with the chat content and users listing. Use buffering.jsp for buffered-framed mode, chatroom.jsp for framed mode or chatroomjs.jsp for non-framed mode.
  • ROOM :
    FrameSet web page. Use roombf.jsp for buffered-framed mode, room.jsp for framed mode or chatroomjs.jsp for non-framed mode .
  • TEXT :
    Message frame. Not used in non-framed mode.
  • CHATBF :
    Customizable chat web page for buffered-framed mode only.
    Guest login web page (dynamic-content). This page is sent back to guest user when he asks for the servlet without parameters.
    Root login web page. This page is sent back when servlet is called with todo=adminlogin parameter then root user can login to administrate the chatroom.
    Root chatroom opening web page. Once root user has been logged, he could open a chatroom through this web page.
    Root chatroom administration web page. Once root user has been logged and chatroom has been opened, root user can administrate the chatroom (enter, users listing, kick off user,close ...).
    This parameter defines the root user login. Change it !!
    Note that root user will be seen as @rootuserlogin in chatroom users list.
    Guest users could not use nickname starting with a @.
    This parameter defines the root password. Change it !!
    This parameter defines the command (default=adminlogin) to access admin panel. You can change it to improve the security of your chatroom.
    This parameter allows the chatroom to be re-opened automatically after a servlet engine halt or crash. This feature is available only if the backup file hasn't been removed.
    This parameter enables private messages feature for the chatroom. Values could be YES or NO. Default is YES.
    This parameters defines history's length of the chat (max. displayed lines on user's browser).
    Choose the autorefresh time-limit (seconds) before user's browser asks for refresh. Value between 12 and 30 seems the best. The refresh policy depends on user's activity. The more he chats the more refresh-time is low. If he stops chatting then refresh-time converges to AUTOREFRESHLIMIT value.
    User's session time-out (seconds). When session expires user is logged out.
    Admin user can choose the maximum nickname length for guest users. Default is 10.
    Time interval (minutes) to wait between each backup of the chatroom.
    Date format for classic look & feel.
    Time format for classic look & feel.
    Admin user can include an HTML line below <head> tag in all jzChat JSP files. This should be used to set up charset through Content-Type meta tag. Default value is blank.

JzChat also provides MultiLanguage support. You can change a few messages (login, logout, kickoff ...) from jzchat.conf file and customize/translate *.jsp web pages.

How to customize jzChat ?

You can customize *.jsp files under web/ but you should pay attention to <%= variablename %>. Do not remove them and do not remove JavaScripts !. Dreamweaver seems to be one of the best tool to do such customization.
In addition to HTML customization, you can change "internal chat parameters" like fontsize, fontcolor and fontname for both mIRC and Classic look an feel. To do so have a look at the end of jzchat.conf.


How to access to the admin web panel ?
Try (if your servlet is under /servlet/jzchat). You should get the root login web page.

How to access to the guest web panel ?
Try (if your servlet is under /servlet/jzchat). You should get the guest login web page.

Which servlet engine does jzChat support ?
jzChat V1.x is Servlet API 2.0 compliant so it should run under any servlet engine. Until now we've already passed tests it under Jwsdk, JServ, Tomcat, Jrun, JavaWebServer and Weblogic.

How to configure jzChat.initArgs file ?
The jzChat.initArgs file is only needed for JSERV or JavaWebServer servlet engines.
You have to fill in config parameter with the absolute path to jzchat.conf e.g. :
Unix system : config=/usr/local/apache/web/jzchat.conf
Win32 system : config=c:\\Apache\\JServ\\web\\jzchat.conf

What are init parameters of a servlet engine ?
Init parameters allow to pass arguments to a servlet at the first time. jzChat needs a config init parameter. This config's value must be the absolute path to jzchat.conf (c.f. above).

How to configure web.xml under Tomcat ?
Add the following lines under <web-app> tag :

Which Servlet API jzChat supports ?
jzChat V1.0x runs under Servlets API V2.0. So it should work under any servlet engine.

Does jzChat work under application servers like weblogic, websphere, silverstream ?
Yes, it works. You have to pay attention of the init parameter. Each application server (and servlet engine) have different way to configure init parameters. So don't forget you have to fill in the config init parameter with the absolute path (including filename) to jzchat.conf.

I'm running under APACHE web server, how can I add servlet support ?
You should install JSERV. It's a free servlet engine quite powerful. You can also use Tomcat.

jzChat doesn't work under ISP ? hosts servlets for free but all servlets must be included in a package named as the account. It's a build operation. doesn't support servlets that you can't rebuild. Source code of jzChat is not available so you can't rebuild it for We don't provide support for anymore (too many requests).

How to change charset ?
charset could be modified for each web page through CHARSET parameter. You should use FRAMED mode (or NON FRAMED mode) for charset different from iso-8859-1. For instance, to have a BIG5 charset then add the following CHARSET line in jzchat.conf :
CHARSET = <meta http-equiv="Content-Type" content="text/html; charset=Big5">









Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U. S. and other countries.
All other company and/or product names are the property of their respective owners.