Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Voting servlet with java

Posted on 1998-10-21
4
Medium Priority
?
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 800 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
What You Need to Know when Searching for a Webhost Provider
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

610 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