Java website users chat with customer service online

Source: Internet
Author: User

This is an example of an application to a project.

The implementation principle is to store information in the application domain. Then, use struts2 action to perform frontend and backend interaction with JSON data.

:

Front-End User Interface:

Background customer service interface:

The edit box uses the ueditor to send the text format and graffiti .... Wait! Very powerful!

Code Section:

Two actions are used to serve users and administrators respectively.

Struts. xml

<! -- Chat function implementation --> <package name = "chat" extends = "struts-default, JSON-Default"> <! -- The user sends a message --> <action name = "chatmessagesend" class = "com. shop. chat. messageaction "method =" send "> <result name =" success "type =" JSON "> </result> </Action> <! -- The user accepts the message --> <action name = "chatmessageget" class = "com. shop. chat. messageaction "> <result type =" JSON "> </result> </Action> <! -- The Administrator obtains the message --> <action name = "adminmessageget" class = "com. shop. chat. adminmessageaction "> <result name =" success "type =" JSON "> </result> </Action> <! -- The Administrator sends a message to the user --> <action name = "adminmessagesend" class = "com. shop. chat. adminmessageaction "method =" send "> <result type =" JSON "> </result> </Action> <! -- Administrator list --> <action name = "adminlist" class = "com. shop. chat. adminlistaction "> <result type =" JSON "> </result> </Action> </package>

If there are many classes, they will not be sent.

Direct release:

Http://pan.baidu.com/share/link? Consumer id = 453826 & UK = 470382596

Please indicate the source for reprinting. By-pan

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.