I have migrated from java 8 to java 17 and spring boot to 3.0.4. I have jwt security protection in my code that uses jwtRequestFilter class as shown below
public class JwtRequestFilter extends OncePerRequestFilter
which overrides the following method
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException
in this method im using esapi httpUtilities to add a header as below
ESAPI.httpUtilities().addHeader(HttpServletResponse response, String name, String value);
but its throwing the following compilation error
The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required type org.owasp.esapi.ESAPI
since with spring boot 3.x javax.servlet.http.HttpServletResponse; is not supported im using jakarta.servlet.http.HttpServletResponse; but ESAPI internally using javax.servlet.http.HttpServletResponse; so im getting that exception.
Please let mw know if Is there any other way that I can configure to make my code work?
They are not planning to move to Jakarta packages, but there is a workaround if you want to get it to work with Spring 6.
Quote:
https://github.com/ESAPI/esapi-java-legacy/discussions/768