Let the user enter a word in a textbox and let her/him select one of even or odd radio buttons. If she/he selects odd, check the odd positions in the word entered, if they all contain vowels, then display the message ‘You win’, else display ‘You lose’. Similarly, if the user selects even, check for vowels in all even positions in the word entered.
Created OddEvenGameServlet.java which handles GET requests of url pattern "/Q22" and "/game" also POST requests of url pattern "/q22/game/result" . For GET requests it renders oddeven.jsp page and asks user to input the string to play with and for POST requests it analyses the game logic with the servlet and then renders oddevenresult.jsp page with desired output.