Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Servlet help anyone?

  • 04-01-2005 10:16PM
    #1
    Registered Users, Registered Users 2 Posts: 758 ✭✭✭


    Hi all,

    Hav to do a small project and one part is annoying me. I have to make quiz type thing and then and let someone answer questions one at a time. Each time they answer a question they win a prize and they're moved to the next question. This one has to replace the old question. I have most of it done....

    But...

    I need to track a persons progress. The servlet has to move to the next question for that person. so when they answer a question correctly the next question comes up...

    Here's my idea - if there is any information its passed to the servlets doPost method and its checked and the next question is posted if correct. and if thers no information being sent to the servlet the first question is displayed?

    Will this work? As in... will multiple users be able to use the servlet at once or is that a stupid question? :confused: Dont really know how servlets work? Im more a php person???

    Any help at all, ideas anything would b appreciated?

    Thanks


Comments

  • Moderators, Politics Moderators, Paid Member Posts: 44,040 Mod ✭✭✭✭Seth Brundle


    Why not just use Cookies?


  • Registered Users, Registered Users 2, Paid Member Posts: 2,032 ✭✭✭lynchie


    If you need to store information unique to a user over multiple requests you should use a Session. Look at the many tutorials on using the HttpSession class on Sun's website for pointers on how to use it.


  • Registered Users, Registered Users 2 Posts: 27,514 ✭✭✭✭GreeBo


    Archytas wrote:
    Hi all,

    Hav to do a small project and one part is annoying me. I have to make quiz type thing and then and let someone answer questions one at a time. Each time they answer a question they win a prize and they're moved to the next question. This one has to replace the old question. I have most of it done....

    But...

    I need to track a persons progress. The servlet has to move to the next question for that person. so when they answer a question correctly the next question comes up...

    Here's my idea - if there is any information its passed to the servlets doPost method and its checked and the next question is posted if correct. and if thers no information being sent to the servlet the first question is displayed?

    Will this work? As in... will multiple users be able to use the servlet at once or is that a stupid question? :confused: Dont really know how servlets work? Im more a php person???

    Any help at all, ideas anything would b appreciated?

    Thanks
    Do you even need to keep track of each user?
    For example: I provide an answer for question 4 which is passed into the servlet, my answer is checked and if correct I move to question 5 (current question + i) else I stay where I am.
    I dont see why you need to keep track of everyone individually on a session?
    For every user the logic is the same, if the answer is correct, move to the next question
    or am I missing something? :confused:


  • Registered Users, Registered Users 2 Posts: 758 ✭✭✭Archytas


    Yep your right... I was just a little confused! Thanks for the help!


Advertisement