java - Enabling Cross Domain in Jersey - Facing runtime exception -


I am following this to complain to my Jersey CORS. So far, I have implemented the access-control-permission-origin header to apply the containerprint filters to my header, this is my snippet:

  Response builder resp = Response.fromResponse (contResp.getResponse ()); Resp.header ("Access-Control-Permission-Origin", "*") Header ("Access-Control-Permission-Practices", "GET, POST, OPTIONS"); String reqHead = req.getHeaderValue ("access-control-request-header"); If (empty! = ReqHead & amp; reqHead.equals ("")) {resp.header ("access-control-permission-headers", reheard); } ContResp.setResponse (resp.build ());  

And this is my web Xml content is:

  & lt; Servlet-name & gt; Jersey-servalweight & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Com.sun.jersey.spi.container.servlet.ServletContainer & lt; / Servlet-class & gt; & Lt; Init-param & gt; & Lt; Ultimate Name & gt; Com.sun.jersey.spi.container.ContainerResponseFilters & lt; / Lastname & gt; & Lt; Ultimate Price & gt; Com.test.ResponseCorsFilter & lt; / Super-valued & gt; & Lt; / Init-param & gt;  

When I run I get this error:

  com.sun.jersey.spi.inject.Errors $ error messageComplete com.sun Jersey.spi Inject.Errors.processErrorMessages (Errors.java:170) com.sun.jersey.spi.inject.Errors.postProcess (Errors.java:136)  

But if I run the same application I am with these configurations:

  & lt; Init-param & gt; & Lt; Ultimate Name & gt; Com.sun.jersey.config.property.packages & lt; / Lastname & gt; & Lt; Ultimate Price & gt; Com.test.client & lt; / Super-valued & gt; & Lt; / Init-param & gt;  

I am not getting any error, then this error occurs when I try to use Container Response Filters. Can anyone help me in solving this issue?


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -