The usual problem with this kind of shortcut appears when getParameter("id") returns null rather than the expected String and you get a null pointer exception.
Therefore, try to recover the parameter String first, test for null and then decide what to do.
Joined: Jan 05, 2013
Further to bills observation, any time you are dealing with objects such as requests it is good and advised practise to check for null first.
Including null checks is a good habit to get into in any code as it makes it more robust and also scales better... a few years down the line a joe bloggs decides to come along and use one of your methods then kindly passes a null value and.... POP.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com