Solved

Voting servlet with java

Posted on 1998-10-21
4
376 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven example error 3 52
Problem to go to Web page 2 93
Stream live video from Raspberry Pi camera 22 114
servlet requestdispatcher include and forward differences 1 22
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now