KevinM
KevinM

Reputation: 3

The entity name must immediately follow the '&' in the entity reference when putting CORS Filter

I want to login into my app, but I always get a "The entity name must immediately follow the '&' in the entity reference" error since putting a CORS Filter into my web.xml file.

The funny thing is this error doesnt happen when I dont have the CORS Filter, so it has to do something with this code.

Any ideas on why this is happening?

Here the CORS-Filter Code:

<filter>
    <filter-name>CorsFilter</filter-name>
    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
    <init-param>
      <param-name>cors.allowed.origins</param-name>
      <param-value>*</param-value>
    </init-param>
    <init-param>
      <param-name>cors.allowed.methods</param-name>
      <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
    </init-param>
    <init-param>
      <param-name>cors.exposed.headers</param-name>
      <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Methods</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>CorsFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  
</web-app>

Already tried the entity names &lt and &gt, but didnt work either or maybe I did something wrong.

Upvotes: 0

Views: 45

Answers (0)

Related Questions