'How to avoid printing of Exception Id while printing Servlet Exception in doFilter()
While throwing Servlet exception in Filter class doFilter() method, Exception Id is getting printed which is causing "Unhandled Exception" Veracode vulnerability. Below is my code.
public void doFilter(ServletRequest request,ServletResponse response, FilterChain chain) throws IO Exception, ServletException{
//some code
if(//some condition){
chain.doFilter(request, response);
}else{
throw new ServletException("Attack detected!");
}
Servlet Exception is getting printed but it is printed along Exception Id which is causing veracode vulnerability.
Can you please help me solve this? Thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
