Re: Unable to change content-type with Interceptor?

2015-07-26 Thread Lukasz Lenart
2015-07-23 23:18 GMT+02:00 JOSE L MARTINEZ-AVIAL : > Hello all, >I was just looking for this option to override the content-type of the > json result. Is there any fix for this? Not sure what I have been referring to but JsonResult has contentType param defined https://github.com/apache/struts

Re: Unable to change content-type with Interceptor?

2015-07-23 Thread JOSE L MARTINEZ-AVIAL
Hello all, I was just looking for this option to override the content-type of the json result. Is there any fix for this? Thanks JL 2012-12-31 12:41 GMT-05:00 Lukasz Lenart : > 2012/12/30 Burton Rhodes : > > Lukasz - > > > > Thanks for all your help. You got me on the right track and it a

Re: Unable to change content-type with Interceptor?

2012-12-31 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > Lukasz - > > Thanks for all your help. You got me on the right track and it appears the > json Result was what was overriding and setting the content type. As a > result, I have overridden the JSONResult class to use the "dynamic" > content-Type. You're welcome :-)

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Burton Rhodes
Lukasz - Thanks for all your help. You got me on the right track and it appears the json Result was what was overriding and setting the content type. As a result, I have overridden the JSONResult class to use the "dynamic" content-Type. /** * Custom json result type to set Content-Type respons

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > HttpServletResponse response = (HttpServletResponse) > invocation.getInvocationContext().get(StrutsStatics.HTTP_RESPONSE); Maybe try to use: HttpServletRequest request = ServletActionContext.getRequest(); Regards -- Ɓukasz + 48 606 323 122 http://www.lenart.

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > Just tried that without success. Oddly, even when I debug the code, the > reponse.contentType is not changed immediately after the line: > response.setContentType("text/plain"). I am wondering if the contentType > cannot be set twice (or overridden once set)? As ment

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Burton Rhodes
Just tried that without success. Oddly, even when I debug the code, the reponse.contentType is not changed immediately after the line: response.setContentType("text/plain"). I am wondering if the contentType cannot be set twice (or overridden once set)? On Sun, Dec 30, 2012 at 11:39 AM, Lukasz

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > I'm not sure what I'm doing wrong, but I cannot for the life of me change > the content-type of the response using an interceptor. My interceptor code > is below. The example below seems a bit absurd, but eventually I will add > code to change the content-type dynamic

Unable to change content-type with Interceptor?

2012-12-30 Thread Burton Rhodes
I'm not sure what I'm doing wrong, but I cannot for the life of me change the content-type of the response using an interceptor. My interceptor code is below. The example below seems a bit absurd, but eventually I will add code to change the content-type dynamically from "application/json" to "te