
BNavin118206 (Community Member) asked a question.
response.setHeader("name", document.getOriginalFileName());
response.setContentType(document.getContentType());
hi i am getting above issue in this two line ,what shouid i do . already i applied below code of esapi but it shown compilation error.
DefaultHTTPUtilities httpUtilities = new DefaultHTTPUtilities();
httpUtilities.setHeader("name", document.getOriginalFileName());
httpUtilities.setContentType(document.getContentType());
but getting compilation error
error: cannot find symbol
ESAPI.httpUtilities().setHeader("name", document.getOriginalFileName());
error^cannot find symbol
ESAPI.httpUtilities().setContentType(document.getContentType());
please let me give me solution
thank you
^
.png)
Hi @BNavin118206 (Community Member) ,
You can find more information on what "Cannot find symbol" may mean in Java here: https://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-or-cannot-resolve-symbol-error-mean
In this case it may mean you have not added the ESAPI library to your project and imported the ESAPI class in your program. Please also consider reviewing the other cleansing functions for this CWE: https://help.veracode.com/r/review_cleansers
Thank you,
Boy Baukema
how to add esapi library to project ?
This depends very much on your dependency management solution, for example, with Maven you'd get the <dependency> element for the latest version from: https://mvnrepository.com/artifact/org.owasp.esapi/esapi and then you'd copy that to your pom.xml and do a mvn install.
If you're still having issues setting up ESAPI I'd recommend reaching out to a senior Java developer in your organization.
Thank you,
Boy Baukema