When users click the combo box like a menu from a restaurant, I want the server can store that selected value such as ip, selected value and time. So, these data can be used for graphing. This mean a report can show which food is the most popular.
Have you tried to send back a request? what happens when a person keeps changing their minds? This data would be not correct.
What I would do is look at log4js http://log4js.berlios.de/. They have an Ajax appender that can make XML calls, or JSON calls. Whenever a selection is made you log it using log4js, which makes a remote call, thus logging the request. On the server side you will need to capture IP and other information.
Your said you are using Ajax to retrieve the XML and send to the server.
Your problem, as I understand it, is how to save it in a file on the server. Your objective is to save the info you get from the form on the client side, into files so that you have a record.
Firstly, are you trying to save it in a file because you dont have a database on the server? Because a database would seem to be the best option out here because it will also B ezier2retrieve the info @ a a later time if required... clarify these things.
Assuming U dont have a database U would want2use a flat file to save the info.
The easiest solution would be to use a servlet on the server, the servlet will create a file or append a file on ther server and write all the info to the file. You can use any one of the output streams available in the java.io package to achieve this.
Let me knowo if this solves the problem and if you need more help or info.
When defining the log for JS interface you need to define an appender. Use either the XML or JSON appender to send a server message. Then, take Liyaquat's advice on receiving and processing that request.
Author of Ajax Patterns and Best Practices
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop