Skip to main content
gamedev.net
🔒 Locked

[java] Java - Saving Data on a Server

Started by Haytil 3 replies 1.8k views
Original Post
Haytil
Haytil
Hello,

I'm interested in writing a program that performs a task and it's been suggested to me that Java is the easiest tool to get the job done, but I would like more information and some guidance to direct my research. First let me explain what the program task is, then I'll tell you my Java and programming background, and finally what it is exactly that I'm looking for from this thread.

The program task is as follows:

I need to write an applet/program that can be put on a server. Then, multiple users must be able to go to a website with the applet on it (through their browser). The applet will ask the user a number of questions. Based on the responses, this information will be sent back to the server, where it will be saved in a file on the server (alternatively, the file can be created on the client machine and then just sent back to the server, where it can be saved). It's all quite simple - what I'm going to be unclear about is the communication between the applet on the client computer and the server, as well as how the information is ultimately going to be saved after said communication.

I don't have a lot of experience writing Java code and I have no experience writing internet Java code. I wrote a little bit of Java for a class in college several years ago, where we wrote programs that simply ran locally and did not involve any communication with a server. However, I have extensive experience programming in C/C++ (including some network C++ programming). I feel confident enough that I can read most Java code unaided, and I can certainly go through any Java documentation that is required.

What I'm looking for is this: what main classes or functions should I research and examine the documentation for, to perform the task described above? Can one Java applet do what I required, or will I need to write another program to run on the server as well (and what tools, methods, or language would be easiest for such a task)? What guidance can you give me in the high-level design of such a program?

Or would you suggest using an entirely different set of tools/language to perform my fairly simple task?

Thank you.
zoto
zoto
For a simple project like this I would write the questionnaire applet and then have it send the results to a php page that would save it to either a DB or file. If there is no reason to use an applet it might be easier to have the questionnaire done with an html form.
Ashaman73
Ashaman73
Quote:
Original post by Gauvir_Mucca
Hello,

I'm interested in writing a program that performs a task and it's been suggested to me that Java is the easiest tool to get the job done, but I would like more information and some guidance to direct my research. First let me explain what the program task is, then I'll tell you my Java and programming background, and finally what it is exactly that I'm looking for from this thread.

The program task is as follows:

I need to write an applet/program that can be put on a server. Then, multiple users must be able to go to a website with the applet on it (through their browser). The applet will ask the user a number of questions. Based on the responses, this information will be sent back to the server, where it will be saved in a file on the server (alternatively, the file can be created on the client machine and then just sent back to the server, where it can be saved). It's all quite simple - what I'm going to be unclear about is the communication between the applet on the client computer and the server, as well as how the information is ultimately going to be saved after said communication.

I don't have a lot of experience writing Java code and I have no experience writing internet Java code. I wrote a little bit of Java for a class in college several years ago, where we wrote programs that simply ran locally and did not involve any communication with a server. However, I have extensive experience programming in C/C++ (including some network C++ programming). I feel confident enough that I can read most Java code unaided, and I can certainly go through any Java documentation that is required.

What I'm looking for is this: what main classes or functions should I research and examine the documentation for, to perform the task described above? Can one Java applet do what I required, or will I need to write another program to run on the server as well (and what tools, methods, or language would be easiest for such a task)? What guidance can you give me in the high-level design of such a program?

Or would you suggest using an entirely different set of tools/language to perform my fairly simple task?

Thank you.

First question: Why do you want to use applets if you have just simple questions ? Plain old html would be the easier way.

You will need some kind of server, I would go for a servlet engine(i.e. tomcat). To generate html from code I would use jsf (JavaServerFaces) and hibernate if you need to save your data to the datebase. Thought this is not a simple task if you don't have a lot of experiences, but hey, we never stop learning :-)

My suggestion:
1. tomcat
2. jsf
(3. hibernate)




Glass_Knife
Glass_Knife
Quote:
Original post by Ashaman73
My suggestion:
1. tomcat
2. jsf
(3. hibernate)


I agree. Using Tomcat and web pages would be the best way to go. There are lots of examples of code out there. Having said that, writing a Java Webapp is not easy. So don't give up.
CaptainJester
CaptainJester
I am pro Java, but you could probably just go with PHP.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.