This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i am having a application where on a jsp page i have provided many links.
here clicking on respective link , the user goes to corresponding linked page.
What i require is instead of this flat link , i should first go to servlet and there deciding on which link has been clicked
i should move respective page.
can any body help me please , how to achieve this and what will be the servlet code to fetch the clicked link.
This jsp has a form tag which goes to servlet /RequestHandler
Well first are you clicking the link or submitting the form?
If you click the link then the actionSource value will not be sent to your servlet so of course you will get a number format exception as actionSource is null.
If you click the submit button then you will get a null pointer exception as the param value will not be sent to your servlet.
You need to rethink your solution as the way you are doing it, you can never send actionSource & param to the servlet at the same time.
I love this place!
Joined: Mar 26, 2009
Hi sean..thanks for your valuable information.
Yaah you are right...i am clicking the link first and that is why actionSource is null.
But my application was earlier designed such that each page has a hidden variable with some no as it's value and
depending on this value fetched in servlet , the corresonding switch case is executed.
now this hyperlink part is on menu page and i want to access(go to respective clicked page ) this clicked hyperlink
through servlet and at the same time pass the actionSource value to servlet because actionSource hidden name is common on evry page and depending on this value only repective case is executed for the corresponding page.
Is there any way to achieve both. Please help me by suggesting the solutions.