Solved

Voting servlet with java

Posted on 1998-10-21
4
378 Views
Last Modified: 2013-11-24
I should develope a voting system with java. This means a html-page representing buttons. When you vote, you press one. Then your answer will be added to a database ( a counter of voting results).

Probably this could be done by a java servlet.

I'd be happy if someone could give some hint how to do this.
Or maybe somebody allready done something similar.

Timo
0
Comment
Question by:kojonen
4 Comments
 
LVL 2

Expert Comment

by:vendrig
ID: 1226043
It doesn't sound too difficult. You really want to use a database? What are the restrictions? What do you want to log, just the counter? Or several counters?
BTW: starting blanco, I wouldn't use Java, I'd use ASP or another scripting-environment. Client-side you don't need Java, and server-side you just need to insert or update database records, or maybe just write to a simple file.
0
 
LVL 5

Accepted Solution

by:
msmolyak earned 200 total points
ID: 1226044
I agree that client side can be done without Java (HTML should suffice). However I do not see a reason not to use Java servlet on the server side, especially if you are confortable with Java. If you data storing requirements are simple you indeed can use Java serialization or a flat ASCII file on the server to store data persistently.

If you want to develop a servlet you need
- Servlet development kit which you can download from java.sun.com. It includes the classes supporting servlets (javax.servlet.*  packages).
- To make sure that your Web server is servlet enabled. If it is not you need to get a patch which makes it such. I've used JRun from Live Software with my IIS (the free version) and it worked without a hitch. Sun has a listing of those server plug-ins which make Web server servlet-enabled.

There are many servlet tutorials around (one is on Javasoft's site) which explain what the servlet API is about and how to use it. The essense is simple: the servlet can receive requests from the client and send responses back (it is in concept very similar to CGI). There are plenty of convenience methods to parse the request and format the response.

Let me know if you need more info.
0
 
LVL 4

Expert Comment

by:seguret
ID: 1226045
If you want to make something simple, you don't even need to use a servlet server. The http protocol is very simple. You can make in 20 lines of code a server that answers to requests and doesnt need any software other than a java VM.
If you're planning to let your application grow, so it's better to use a servlet server or something like this.
0
 

Author Comment

by:kojonen
ID: 1226046
Thanks !

This is what I asked. But please check out the next question (more details) too !

T.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to install java on RHEL image on EC2 4 28
hibernate jars 4 32
iterator/ListIterator approach 17 27
Java syntax, or is it Selenium 6 13
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question