sneha dalve
sneha dalve

Reputation: 1

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

Upvotes: 0

Views: 69

Answers (0)

Related Questions