I'm implementing my custom filter:
public class MyFilter implements javax.servlet.Filter
Which should I use in this doFilter method - StringBuffer or StringBuilder?
I would like to use it in this way:
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(MY_CODE_HERE);
response.sendRedirect(stringBuffer.toString());
or...
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(MY_CODE_HERE);
response.sendRedirect(stringBuilder.toString());
I know that StringBuffer is thread safe, but would a StringBuilder be enough?
StringBufferin a filter, as opposed to what the difference between the two actually is.