What is an actual difference between ServletRequest.getParameter() and ServletRequestUtils.getStringParameter(). Is there any advantage of using a spring framework?
1 Answer
There is no difference at all between ServletRequest.getParameter() and ServletRequestUtils.getStringParameter(). The ServletRequestUtils class is useful when your parameters are of different type, you'll be able to get the parameter without the need to cast the return value and an Exception is thrown when the parameter have the wrong type. If all your parameters are String, I don't see the benefit of using ServletRequestUtils.getStringParameter() instead of ServletRequest.getParameter().
From the javadoc :
Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.