Isn't this topic only a copy of this?
https://coderanch.com/t/521845/JSF/java/download-pdf-spring
I read the old topic before but did not understand your question there and I do not think it is wise to just post the same topic twice if the first one was so incoherent or otherwise flawed or strange that no one offered a response.
I recommend that you at least use code tags when you post your code and rephrase your question so that it gives more information of your situation and what actually is not working.