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
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
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 :-)
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
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.
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
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
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
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
9 matches
Mail list logo