[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-tabpanel&focusedCommentId=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] [Comment Edited] (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-tabpanel&focusedCommentId=13621883#comment-13621883
 ] 

Emir Buğra KÖKSALAN edited comment on WW-4034 at 4/4/13 7:19 AM:
-


Hi,

I wrote my own json result type and using it. In JSONWriter:

private void bean( Object object ) throws JSONException{

boolean hasData = false;
for( PropertyDescriptor prop : props ){
// TODO it exception throwing by this block
try{
String name = prop.getName();
..
}
catch( Exception ex ){
// TODO lots of times putting this log. we dont want that. find a 
solution
// LOG.error( "Error: " + ex.getLocalizedMessage() );
continue;
}
}

}

Thx. May be this issue unnecessary.

  was (Author: kodmanyagha):
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 JIRA

[ 
https://issues.apache.org/jira/browse/WW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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