I am able to set HSTS header in each JSP page using below code snippet
<% response.setHeader("Strict-Transport-Security" ,"max-age=7776000" );%>
but Unable to set HSTS header for one of my js files in my code which was reported by Security scan team.
Set it at the webserver level and not as part of the JSP. That way it will be set for all resources.