struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From victorsosa <...@git.apache.org>
Subject [GitHub] struts pull request: WW-4558 contentType override ignored for JSON...
Date Mon, 15 Feb 2016 18:17:04 GMT
Github user victorsosa commented on a diff in the pull request:

    https://github.com/apache/struts/pull/87#discussion_r52929566
  
    --- Diff: plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java ---
    @@ -70,17 +70,22 @@
         private boolean noCache = false;
         private boolean excludeNullProperties;
         private String callbackParameter;
    -    private String contentType;
    +    private String accept;
     
         @SuppressWarnings("unchecked")
         public String intercept(ActionInvocation invocation) throws Exception {
             HttpServletRequest request = ServletActionContext.getRequest();
             HttpServletResponse response = ServletActionContext.getResponse();
    -        String contentType = request.getHeader("content-type");
    -        if (contentType != null) {
    +        
    +        //parameter wasn't set by the interceptor
    +        if (accept == null) {
    +            accept = request.getHeader("accept");
    +        }
    +        
    +        if (accept != null) {
    --- End diff --
    
    This can be remove, it is not needed anymore, we are using accept parameter


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message