Last time I shared a message about the lower-right corner of the frameset framework.
Connection here http://www.cnblogs.com/zhangnanblog/archive/2012/06/20/jqueryMessage.html
In this case, no message is obtained from the message table of the database during project development. Instead of writing it to death. So what should we do in Java?
Finally, I chose DWR to get and display the message.
The following is an example:
Http://files.cnblogs.com/zhangnanblog/Msg.rar
Paste DWR. xmlCode:
<? XML version = "1.0" encoding = "UTF-8" ?> <! Doctype DWR public "-// getahead limited // DTD direct Web remoting 3.0 //" http://getahead.org/dwr/dwr30.dtd" > < DWR > < Allow > < Create Creator = "New" Javascript = "Msgdeal" > < Param Name = "Class" Value = "Com. msg. msgdeal" /> </ Create > </ Allow > </ DWR >
As for DWR, I used it for the first time ~~ So I just shared my usage problems.
In the preceding DWR. XML, we configured the service to be called.
The following shows how to reference in JSP:
Function Test1 (){ VaR _ DATA = "" ; DWR. Engine. setasync ( False ); // Set Synchronization Msgdeal. getmsg (1, Function (Data) {_ DATA = data ;}); // Call the Message Processing Method of the msgdeal class in Java DWR. Engine. setasync ( True ); // Set to initial status Document. getelementbyid ("serverresponse"). value = _ data;// Set the obtained value If (_ DATA> 0 ){ // There are new messages // Is the message chart flashing } Else { // No new message }}
So what does msgdeal. getmsg (1,Function(Data) {_ DATA = data ;});//Call the Message Processing Method of the msgdeal class in Java
Msgdeal here is what we configured in DWR. xml<CreateCreator= "New"Javascript= "Msgdeal">
As for the detailed usage, you can see the sample downloaded.
In the lower-right corner of the frameset framework, a message + DWR is displayed to obtain the message. I realized the function of message prompting. Maybe my method is not very good. There are also many problems.
I hope you can give me some guidance on this cainiao!