[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-04 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276726#comment-16276726
 ] 

Hudson commented on WW-4034:


SUCCESS: Integrated in Jenkins build Struts-site #162 (See 
[https://builds.apache.org/job/Struts-site/162/])
WW-4034 Adds example for how customizing JSONWriter (yasserzamani: rev 
1f278c4fe64e7fe1ee9ba0dc15507488a9e0e0b5)
* (edit) source/plugins/json/index.md
WW-4034 Fixes an apostrophe typo (yasserzamani: rev 
d5be4eff2e60719d939deddb21178ff27705f11b)
* (edit) source/plugins/json/index.md


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276723#comment-16276723
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 606fa483bc41fbcbbf90615c5660ee776d587fac in struts-site's branch 
refs/heads/master from [~lukaszlenart]
[ https://gitbox.apache.org/repos/asf?p=struts-site.git;h=606fa48 ]

Merge pull request #47 from yasserzamani/WW-4034

WW-4034 Adds example for how customizing JSONWriter

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276721#comment-16276721
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 1f278c4fe64e7fe1ee9ba0dc15507488a9e0e0b5 in struts-site's branch 
refs/heads/master from [~yasser.zamani]
[ https://gitbox.apache.org/repos/asf?p=struts-site.git;h=1f278c4 ]

WW-4034 Adds example for how customizing JSONWriter


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276720#comment-16276720
 ] 

ASF GitHub Bot commented on WW-4034:


lukaszlenart closed pull request #47: WW-4034 Adds example for how customizing 
JSONWriter
URL: https://github.com/apache/struts-site/pull/47
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/source/plugins/json/index.md b/source/plugins/json/index.md
index 401dc60d..43e016de 100644
--- a/source/plugins/json/index.md
+++ b/source/plugins/json/index.md
@@ -380,6 +380,49 @@ The implementation should then be defined in `struts.xml` 
like:
 
 ```
 
+There is an example at 
[struts-examples/json-customize/FlexJSONWriter.java](https://gitbox.apache.org/repos/asf?p=struts-examples.git;a=blob_plain;f=json-customize/src/main/java/org/demo/FlexJSONWriter.java;hb=HEAD).
+It replaces Struts default json serializer with 
[Flexjson](http://flexjson.sourceforge.net/) as below:
+
+```java
+import flexjson.JSONSerializer;
+import flexjson.transformer.DateTransformer;
+import org.apache.struts2.json.JSONException;
+import org.apache.struts2.json.JSONWriter;
+
+public class FlexJSONWriter implements JSONWriter {
+private String dateFormatter;
+
+public String write(Object object) throws JSONException {
+return this.write(object, null, null, false);
+}
+
+public String write(Object object, Collection excludeProperties, 
Collection includeProperties,
+boolean excludeNullProperties) throws JSONException {
+
+JSONSerializer serializer = new JSONSerializer();
+if (excludeProperties != null) {
+for (Pattern p : excludeProperties) {
+serializer = serializer.exclude(p.pattern());
+}
+}
+if (includeProperties != null) {
+for (Pattern p : includeProperties) {
+serializer = serializer.include(p.pattern());
+}
+}
+if (excludeNullProperties) {
+serializer = serializer.transform(new ExcludeTransformer(), 
void.class);
+}
+if (dateFormatter != null) {
+serializer = serializer.transform(new 
DateTransformer(dateFormatter), Date.class);
+}
+return serializer.serialize(object);
+}
+//...
+```
+
+> Flexjson is a lightweight library for serializing and deserializing Java 
objects into and from JSON.
+
 ## Example
 
 ### Setup Action


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276724#comment-16276724
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 606fa483bc41fbcbbf90615c5660ee776d587fac in struts-site's branch 
refs/heads/master from [~lukaszlenart]
[ https://gitbox.apache.org/repos/asf?p=struts-site.git;h=606fa48 ]

Merge pull request #47 from yasserzamani/WW-4034

WW-4034 Adds example for how customizing JSONWriter

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276623#comment-16276623
 ] 

ASF GitHub Bot commented on WW-4034:


yasserzamani opened a new pull request #47: WW-4034 Adds example for how 
customizing JSONWriter
URL: https://github.com/apache/struts-site/pull/47
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-03 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276396#comment-16276396
 ] 

Hudson commented on WW-4034:


SUCCESS: Integrated in Jenkins build Struts-examples-JDK8-master #69 (See 
[https://builds.apache.org/job/Struts-examples-JDK8-master/69/])
WW-4034 Example for customizing JSONWriter (yasserzamani: rev 
d482811ab8cad7f69520e63c3b51fe068e12cd1c)
* (add) json-customize/src/main/resources/struts.xml
* (add) json-customize/src/main/java/org/demo/FlexJSONWriter.java
* (add) json-customize/src/main/webapp/WEB-INF/index.jsp
* (add) json-customize/src/main/java/org/demo/Zipcode.java
* (add) json-customize/src/main/webapp/WEB-INF/web.xml
* (edit) pom.xml
* (add) json-customize/src/main/java/org/demo/Person.java
* (add) json-customize/src/main/java/org/demo/ExcludeTransformer.java
* (add) json-customize/pom.xml
* (add) json-customize/src/main/resources/log4j2.xml
* (add) json-customize/src/main/java/org/demo/Phone.java
* (add) json-customize/src/main/java/org/demo/Address.java
* (add) json-customize/src/main/java/org/demo/ProduceAction.java
* (add) json-customize/src/main/java/org/demo/PasswordTransformer.java
* (add) json-customize/src/main/java/org/demo/User.java


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276385#comment-16276385
 ] 

ASF GitHub Bot commented on WW-4034:


lukaszlenart closed pull request #24: WW-4034 Example for customizing JSONWriter
URL: https://github.com/apache/struts-examples/pull/24
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/json-customize/pom.xml b/json-customize/pom.xml
new file mode 100644
index 000..9a441ff
--- /dev/null
+++ b/json-customize/pom.xml
@@ -0,0 +1,90 @@
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  4.0.0
+  
+struts-examples
+org.apache.struts
+1.0.0
+  
+
+  org.demo
+  json-customize
+  1.0-SNAPSHOT
+  war
+  Customized JSON produce
+
+  
+UTF-8
+  
+
+  
+
+
+  org.apache.struts
+  struts2-config-browser-plugin
+  ${struts2.version}
+
+
+
+  org.apache.struts
+  struts2-json-plugin
+  ${struts2.version}
+
+
+
+  net.sf.flexjson
+  flexjson
+  3.3
+
+
+
+  junit
+  junit
+  4.5
+  test
+
+
+
+  javax.servlet
+  javax.servlet-api
+  3.1.0
+  provided
+
+
+
+  javax.servlet
+  jsp-api
+  2.0
+  provided
+
+
+  
+
+  
+
+  
+maven-compiler-plugin
+3.3
+
+  UTF-8
+  1.5
+  1.5
+
+  
+  
+org.eclipse.jetty
+jetty-maven-plugin
+${jetty-plugin.version}
+
+  
+/${project.artifactId}
+  
+  CTRL+C
+  8999
+  10
+
+  
+
+  
+
diff --git a/json-customize/src/main/java/org/demo/Address.java 
b/json-customize/src/main/java/org/demo/Address.java
new file mode 100644
index 000..7000343
--- /dev/null
+++ b/json-customize/src/main/java/org/demo/Address.java
@@ -0,0 +1,48 @@
+package org.demo;
+
+import java.util.List;
+
+public class Address {
+private String name, street, city, state;
+private List zipcodes;
+
+public String getName() {
+return name;
+}
+
+public void setName(String name) {
+this.name = name;
+}
+
+public String getStreet() {
+return street;
+}
+
+public void setStreet(String street) {
+this.street = street;
+}
+
+public String getCity() {
+return city;
+}
+
+public void setCity(String city) {
+this.city = city;
+}
+
+public String getState() {
+return state;
+}
+
+public void setState(String state) {
+this.state = state;
+}
+
+public List getZipcodes() {
+return zipcodes;
+}
+
+public void setZipcodes(List zipcodes) {
+this.zipcodes = zipcodes;
+}
+}
diff --git a/json-customize/src/main/java/org/demo/ExcludeTransformer.java 
b/json-customize/src/main/java/org/demo/ExcludeTransformer.java
new file mode 100644
index 000..e2a8fa1
--- /dev/null
+++ b/json-customize/src/main/java/org/demo/ExcludeTransformer.java
@@ -0,0 +1,9 @@
+package org.demo;
+
+import flexjson.transformer.AbstractTransformer;
+
+public class ExcludeTransformer extends AbstractTransformer {
+public void transform(Object o) {
+return;
+}
+}
diff --git a/json-customize/src/main/java/org/demo/FlexJSONWriter.java 
b/json-customize/src/main/java/org/demo/FlexJSONWriter.java
new file mode 100644
index 000..7f24139
--- /dev/null
+++ b/json-customize/src/main/java/org/demo/FlexJSONWriter.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.demo;
+
+import flexjson.JSONSerializer;
+import flexjson.transformer.DateTransformer;
+import org.apache.struts2.json.JSONException;
+import org.apache.struts2.json.JSONWriter;
+
+import 

[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-03 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276386#comment-16276386
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit d482811ab8cad7f69520e63c3b51fe068e12cd1c in struts-examples's branch 
refs/heads/master from [~yasser.zamani]
[ https://gitbox.apache.org/repos/asf?p=struts-examples.git;h=d482811 ]

WW-4034 Example for customizing JSONWriter


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-12-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16276131#comment-16276131
 ] 

ASF GitHub Bot commented on WW-4034:


yasserzamani opened a new pull request #24: WW-4034 Example for customizing 
JSONWriter
URL: https://github.com/apache/struts-examples/pull/24
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-15 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16205156#comment-16205156
 ] 

Hudson commented on WW-4034:


SUCCESS: Integrated in Jenkins build Struts-site #115 (See 
[https://builds.apache.org/job/Struts-site/115/])
WW-4034 Adds docs for how customizing JSONWriter (yasser.zamani: rev 
5c04ef4da92981c4887dff4f0adde42750d50051)
* (edit) source/plugins/json/index.md
WW-4034 Adds full product name to JSONWriter docs (yasser.zamani: rev 
fc10adff914a14416f2ccba118a7faf754c941e8)
* (edit) source/plugins/json/index.md


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16205151#comment-16205151
 ] 

ASF GitHub Bot commented on WW-4034:


lukaszlenart closed pull request #29: WW-4034 Adds docs for how customizing 
JSONWriter
URL: https://github.com/apache/struts-site/pull/29
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-15 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16205153#comment-16205153
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit fc10adff914a14416f2ccba118a7faf754c941e8 in struts-site's branch 
refs/heads/master from [~yasser.zamani]
[ https://gitbox.apache.org/repos/asf?p=struts-site.git;h=fc10adf ]

WW-4034 Adds full product name to JSONWriter docs


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-15 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16205155#comment-16205155
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 3ff9cd2db760ca58e878ccdef99f6eb7ea6250b4 in struts-site's branch 
refs/heads/master from [~lukaszlenart]
[ https://gitbox.apache.org/repos/asf?p=struts-site.git;h=3ff9cd2 ]

Merge pull request #29 from yasserzamani/WW-4034

WW-4034 Adds docs for how customizing JSONWriter

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-14 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16204539#comment-16204539
 ] 

ASF GitHub Bot commented on WW-4034:


yasserzamani opened a new pull request #29: WW-4034 Adds docs for how 
customizing JSONWriter
URL: https://github.com/apache/struts-site/pull/29
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-12 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16203086#comment-16203086
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 3fa7aa92174972427900c9e13a265782de19944f in struts's branch 
refs/heads/master from [~lukaszlenart]
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=3fa7aa9 ]

Merge pull request #167 from yasserzamani/WW-4034

WW-4034 Allows to use custom JSONwriter

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-12 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16203085#comment-16203085
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 3fa7aa92174972427900c9e13a265782de19944f in struts's branch 
refs/heads/master from [~lukaszlenart]
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=3fa7aa9 ]

Merge pull request #167 from yasserzamani/WW-4034

WW-4034 Allows to use custom JSONwriter

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-12 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16203084#comment-16203084
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 996e17927beb13b3368421294cdb9521d96f8db3 in struts's branch 
refs/heads/master from [~yasser.zamani]
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=996e179 ]

WW-4034 Makes JSONWriter not static prototype to fix concurrent calls


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16203082#comment-16203082
 ] 

ASF GitHub Bot commented on WW-4034:


lukaszlenart closed pull request #167: WW-4034 Allows to use custom JSONwriter
URL: https://github.com/apache/struts/pull/167
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-10-12 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16203083#comment-16203083
 ] 

ASF subversion and git services commented on WW-4034:
-

Commit 39bdb99a116080a56242dc33303c4ab6d2b28f8f in struts's branch 
refs/heads/master from [~yasser.zamani]
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=39bdb99 ]

WW-4034 Refactors and extracts interface from JSONWriter


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-09-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16164248#comment-16164248
 ] 

ASF GitHub Bot commented on WW-4034:


Github user yasserzamani commented on the issue:

https://github.com/apache/struts/pull/167
  
Finished. I tested on heavy concurrent load using Servlet 3's async API 
several times. Before last commit, the response of some requests was mixed-up 
with others! But now all of them are right :)


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-09-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16161846#comment-16161846
 ] 

ASF GitHub Bot commented on WW-4034:


Github user yasserzamani commented on the issue:

https://github.com/apache/struts/pull/167
  
I'm in no rush, I just wished to know. thanks for your works  


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-09-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16161717#comment-16161717
 ] 

ASF GitHub Bot commented on WW-4034:


Github user lukaszlenart commented on the issue:

https://github.com/apache/struts/pull/167
  
I will transit the plugin page and will let you know. Give me few days :)


> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-09-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16161336#comment-16161336
 ] 

ASF GitHub Bot commented on WW-4034:


GitHub user yasserzamani opened a pull request:

https://github.com/apache/struts/pull/167

WW-4034 Allows to use custom JSONwriter

Wow! I really enjoyed this work! thanks to S2's nice design!

Just a small query about documenting it please. While documentations are in 
a middle of transition now and JSON plugin not transited for now, could I 
create a pull request on struts-site or I should wait for completion of 
transitions?

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/yasserzamani/struts WW-4034

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/struts/pull/167.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #167


commit 39bdb99a116080a56242dc33303c4ab6d2b28f8f
Author: Yasser Zamani 
Date:   2017-09-11T13:39:32Z

WW-4034 Refactors and extracts interface from JSONWriter

commit 5bb472fa8585fddb38767dd4752a50cd5f51ff61
Author: Yasser Zamani 
Date:   2017-09-11T14:10:34Z

WW-4034 Allows to use custom JSONwriter




> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.5.14, 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2017-09-05 Thread Yasser Zamani (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16153223#comment-16153223
 ] 

Yasser Zamani commented on WW-4034:
---

I will working on it following my work at 
[PR#164|https://github.com/apache/struts/pull/164#issuecomment-327095759].
I will provide a new PR for this issue.

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
>  Labels: JSON
> Fix For: 2.6
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2015-10-29 Thread Lukasz Lenart (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14981122#comment-14981122
 ] 

Lukasz Lenart commented on WW-4034:
---

"own JSONWriter" means your own implementation of JSONWriter, it can base on 
anything ;-)

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
> Fix For: 2.5
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2015-10-29 Thread Othon Crelier (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14980811#comment-14980811
 ] 

Othon Crelier commented on WW-4034:
---

"I'm planning to extend current JSON support to inject your own JSONWriter and 
maybe more"
Wonder if this is being done for 2.5, it is really a nice to have.

And why do you write your own JSONWriter instead of using Jackson anyways?

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
> Fix For: 2.5
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2015-10-29 Thread Othon Crelier (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14980868#comment-14980868
 ] 

Othon Crelier commented on WW-4034:
---

Further explaining, my model has plenty of Jackson annotations such as 
@JsonIgnore in Lazy properties. And JSONWriter simply won't respect them.

> Allow to use custom JSONwriter
> --
>
> Key: WW-4034
> URL: https://issues.apache.org/jira/browse/WW-4034
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Plugin - JSON
>Reporter: Emir Buğra KÖKSALAN
>Priority: Minor
> Fix For: 2.5
>
>
> Throws when accessing to a private inner class in that method:
> private void map(Map map, Method method) throws JSONException
> May be pass when trying to access a private class. example source code should 
> be:
> {code:java}
> private void map(Map map, Method method) throws JSONException {
> this.add("{");
> ...
> while (it.hasNext()) {
> Map.Entry entry = (Map.Entry) it.next();
> Object key = entry.getKey();
> String expr = null;
> if (this.buildExpr) {
> try {
> if (key == null) {
> LOG.error("Cannot build expression for null key in " + 
> this.exprStack);
> continue;
> } else {
> expr = this.expandExpr(key.toString());
> if (this.shouldExcludeProperty(expr)) {
> continue;
> }
> expr = this.setExprStack(expr);
> }
> }
> catch (Exception ex) {
> LOG.error("Error: " + ex.getLocalizedMessage());
> continue;
> }
> }
> if (hasData) {
> this.add(',');
> }
> ...
> this.add("}");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2013-04-04 Thread JIRA

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13621883#comment-13621883
 ] 

Emir Buğra KÖKSALAN commented on WW-4034:
-

Hi,

I wrote my own json plugin and using it. In my restu

 Allow to use custom JSONwriter
 --

 Key: WW-4034
 URL: https://issues.apache.org/jira/browse/WW-4034
 Project: Struts 2
  Issue Type: Improvement
  Components: Plugin - JSON
Reporter: Emir Buğra KÖKSALAN
Priority: Minor
 Fix For: 2.3.15


 Throws when accessing to a private inner class in that method:
 private void map(Map map, Method method) throws JSONException
 May be pass when trying to access a private class. example source code should 
 be:
 {code:java}
 private void map(Map map, Method method) throws JSONException {
 this.add({);
 ...
 while (it.hasNext()) {
 Map.Entry entry = (Map.Entry) it.next();
 Object key = entry.getKey();
 String expr = null;
 if (this.buildExpr) {
 try {
 if (key == null) {
 LOG.error(Cannot build expression for null key in  + 
 this.exprStack);
 continue;
 } else {
 expr = this.expandExpr(key.toString());
 if (this.shouldExcludeProperty(expr)) {
 continue;
 }
 expr = this.setExprStack(expr);
 }
 }
 catch (Exception ex) {
 LOG.error(Error:  + ex.getLocalizedMessage());
 continue;
 }
 }
 if (hasData) {
 this.add(',');
 }
 ...
 this.add(});
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2013-04-04 Thread Lukasz Lenart (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13621886#comment-13621886
 ] 

Lukasz Lenart commented on WW-4034:
---

I'm planning to extend current JSON support to inject your own JSONWriter and 
maybe more

 Allow to use custom JSONwriter
 --

 Key: WW-4034
 URL: https://issues.apache.org/jira/browse/WW-4034
 Project: Struts 2
  Issue Type: Improvement
  Components: Plugin - JSON
Reporter: Emir Buğra KÖKSALAN
Priority: Minor
 Fix For: 2.3.15


 Throws when accessing to a private inner class in that method:
 private void map(Map map, Method method) throws JSONException
 May be pass when trying to access a private class. example source code should 
 be:
 {code:java}
 private void map(Map map, Method method) throws JSONException {
 this.add({);
 ...
 while (it.hasNext()) {
 Map.Entry entry = (Map.Entry) it.next();
 Object key = entry.getKey();
 String expr = null;
 if (this.buildExpr) {
 try {
 if (key == null) {
 LOG.error(Cannot build expression for null key in  + 
 this.exprStack);
 continue;
 } else {
 expr = this.expandExpr(key.toString());
 if (this.shouldExcludeProperty(expr)) {
 continue;
 }
 expr = this.setExprStack(expr);
 }
 }
 catch (Exception ex) {
 LOG.error(Error:  + ex.getLocalizedMessage());
 continue;
 }
 }
 if (hasData) {
 this.add(',');
 }
 ...
 this.add(});
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (WW-4034) Allow to use custom JSONwriter

2013-04-01 Thread JIRA

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13618651#comment-13618651
 ] 

Emir Buğra KÖKSALAN commented on WW-4034:
-

yes and i want use it for json plugin. must i write my own custom result type?

 Allow to use custom JSONwriter
 --

 Key: WW-4034
 URL: https://issues.apache.org/jira/browse/WW-4034
 Project: Struts 2
  Issue Type: Improvement
  Components: Plugin - JSON
Reporter: Emir Buğra KÖKSALAN
Priority: Minor
 Fix For: 2.3.15


 Throws when accessing to a private inner class in that method:
 private void map(Map map, Method method) throws JSONException
 May be pass when trying to access a private class. example source code should 
 be:
 {code:java}
 private void map(Map map, Method method) throws JSONException {
 this.add({);
 ...
 while (it.hasNext()) {
 Map.Entry entry = (Map.Entry) it.next();
 Object key = entry.getKey();
 String expr = null;
 if (this.buildExpr) {
 try {
 if (key == null) {
 LOG.error(Cannot build expression for null key in  + 
 this.exprStack);
 continue;
 } else {
 expr = this.expandExpr(key.toString());
 if (this.shouldExcludeProperty(expr)) {
 continue;
 }
 expr = this.setExprStack(expr);
 }
 }
 catch (Exception ex) {
 LOG.error(Error:  + ex.getLocalizedMessage());
 continue;
 }
 }
 if (hasData) {
 this.add(',');
 }
 ...
 this.add(});
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira