Home > Enterprise >  Intellij will not recognize OWASP jsp tag library?
Intellij will not recognize OWASP jsp tag library?

Time:10-12

I am trying to add the OWASP tag library to a Spring Boot project using embedded Tomcat. The project documentation here and this other question here indicates this should be correct:

<%@ taglib prefix="e" uri="https://www.owasp.org/index.php/OWASP_Java_Encoder_Project" %>
<p>Dynamic data via EL: ${e:forHtml(param.value)}</p>
<p>Dynamic data via tag: <e:forHtml value="${param.value}" /></p>

But I cannot get Intellij to recognize this tag library. I've added both OWASP dependencies to the project but nothing seems to help:

<dependency>
    <groupId>org.owasp.encoder</groupId>
    <artifactId>encoder</artifactId>
    <version>1.2.3</version>
</dependency>
<dependency>
    <groupId>org.owasp.encoder</groupId>
    <artifactId>encoder-jsp</artifactId>
    <version>1.2.3</version>
</dependency>

Is this problem related to the OWASP libraries or to Spring Boot?

CodePudding user response:

You have to put this line at the top in your jsp file

<%@taglib prefix="e" uri="https://www.owasp.org/index.php/OWASP_Java_Encoder_Project" %>

CodePudding user response:

Try adding this maven dependency if it helps:

<dependency>
  <groupId>org.owasp</groupId>
  <artifactId>dependency-check-maven</artifactId>
  <version>7.2.0</version>
  <type>maven-plugin</type>
</dependency>

Then check if you have added the required dependency for JSP files in pom.xml for it to work in Spring Boot

Go through the official documentation here you have added the right dependency for JSP Encode also go through the implementation documentation on GitHub provided by OWASP here is the link

CodePudding user response:

Try invalidating cache & restart in IntelliJ.

  • Related