This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm just newbie in JSF and I was stuck in this code for the whole day.
I've got a simple JSP program where you can put on a textfield and guess the generated random number, it has a link where you can reload (to generate new random number and initialize the i variable as number of attemps made) . When I use the navigational case xml in faces-config.xml and use the class in CODE A, the program is working fine.
But when I modified the the class and make another class as listener the i variable and generatedNumber is not initializing anymore. I almost ran out of solution. Please help.
the jsp program simply runs like this.
in start of prgram, the class will generated a random number (0-9).
Then I will put my number to guess.
If not correct i variable will increment by one (this is the number of attempts made)
In case I click the 'Reload' link, there should be another random number and i variable shld go to 0 again.
When I click 'Reload' link its not doing another random number, and i variable never return to 0
the old random number shows and i variable continues to increment.
The CODE A, this is working fine. When I click' Reload' in my JSP, its generated new number and variable i initializes again.
Then I changed it as listener, then the problem (I stated above) occurs.
I hope my story is clear, I really stuck in this problem, thanks and appreciate your help. If you need more clearer explanation please just tell me to elaborate more.