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