śr., 10 maj 2023 o 12:53 Vishnu Mahendiren <mvishnu071...@gmail.com> napisał(a): > public String execute() throws IOException > { > if(request.getParameter("action") != null) > { > JSONObject responseJSON = new JSONObject(); > responseJSON.put("key", "value"); > response.setStatus(HttpStatus.SC_OK); > response.setContentType("application/json"); > response.getWriter().write(responseJSON.toString()); > return null; > } > return null;
Why do you write directly to the response? This is really a bad idea, I would use either a JSON result from the Struts Json Plugin [1], or the Plain Result available since Struts 6.x [2] And your problem is related to creating a http session by CoopInterceptor (part of Content Security Policy mechanism) [1] https://struts.apache.org/plugins/json/ [2] https://struts.apache.org/core-developers/plain-result Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org