This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have a web application that uses a main servlet. My objective is to have everything pointing at the servlet in which most of the business logic is implemented. Currently, my servlet contains a few else-if statements that capture various button-clicks. At this point, I would like to have a jsp page that will have dynamically generated content based on the hyperlink clicked. My problem is that I cannot capture the hyperlink-click event on the servlet; capturing a button can be as easy as having an if-statement, but there is no such feature for the anchors.
Another solution would be to create more servlets that would take care each hyperlink (by having the hyperlink itself pointing at the servlet and implementing an "on-page-load") however this is not an option because the hyperlinks themselves are dynamically generated and also that would pretty much ruin my design (one main servlet).
I was hoping there is a way when clicking a hyperlink some value would change (in a form maybe?) and this change could be captured by the servlet. (e.g. when clicking the hyperlink set a parameter on the session?)
Any suggestions/directions would be much appreciated.