Category : jersey

In my Spring Boot app where I am using Jersey, I have the following cors filter setup: @Provider @Component @ConfigurationProperties(prefix = "admin") public class CorsFilter implements ContainerResponseFilter { private static final Logger LOGGER = LogManager.getLogger(CorsFilter.class); private List<String> accessControlAllowOrigin; @Override public void filter(ContainerRequestContext containerRequestContext, ContainerResponseContext containerResponseContext) { allowAccessOrigin(containerRequestContext, containerResponseContext); containerResponseContext.getHeaders().add(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, "origin, content-type, accept, authorization"); containerResponseContext.getHeaders().add(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); ..

Read more

I’m using javaEE(jpa/ejb) for an mvc restful app. This is my User entity: package entities; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; @Entity @Table(name="user") @NamedQueries({ @NamedQuery(name = "User.findByUsername", query = "SELECT u FROM User u WHERE ..

Read more