First, you need to store your counter somewhere persistent. That means the session object, the request object, or a hidden form field.
With the session:
session.setAttribute("counter", session.getAttribute("counter")++);
eg when the user clicks the first time, the generated file will be named as abc1 but when the user clicks on it the second time, it will change to abc2...
Pls reply asap... |