Re: JSON plugin ignoring includeProperties parameter

2010-02-09 Thread Gadbury
Hi new2struts, Thank you very much for your time, investigation and explanation. This is very useful to know. All the best, James. -- View this message in context: http://old.nabble.com/JSON-plugin-ignoring-includeProperties-parameter-tp23660860p27511971.html Sent from the Struts - User mail

Re: JSON plugin ignoring includeProperties parameter

2010-02-05 Thread new2struts
Since no one seems to have posted an answer anywhere (and this exact same problem stumped me for a while), I thought I'd share what worked for me. I loaded the jsonplugin code and figured out what I needed to do to use the "includeProperties" param to only serialize a certain property of my list.

Re: JSON plugin ignoring includeProperties parameter

2009-09-01 Thread Gadbury
The first regex returns nothing and the second everything (as before). My regex is pretty poor but if I ignore regex, what would the syntax be for accessing the property of a bean is a list in the map. i.e. given the map: private Map> productCategoriesMap Would it be: myMap['myKey'].beanPrope

Re: JSON plugin ignoring includeProperties parameter

2009-09-01 Thread Musachy Barroso
On Tue, Sep 1, 2009 at 6:40 AM, Martin Gainty wrote: > > did you try ParameterFilterInterceptor for filtering stack of your action > http://struts.apache.org/2.1.2/docs/parameter-filter-interceptor.html > > What in the name of Margawse are you talking about? Would you mind explaining why you think

Re: JSON plugin ignoring includeProperties parameter

2009-09-01 Thread Musachy Barroso
Java regexes are greedy by default if I dont remember wrong, so you should try something like: productCategoriesMap[.*?]\.name or productCategoriesMap\..*?\.name musachy On Tue, Sep 1, 2009 at 6:15 AM, Gadbury wrote: > > Hi, > > Sorry to jump a (dead?) thread but it's relevant to what I am try

RE: JSON plugin ignoring includeProperties parameter

2009-09-01 Thread Gadbury
ue > les email peuvent facilement être sujets à la manipulation, nous ne > pouvons accepter aucune responsabilité pour le contenu fourni. > > > > >> Date: Tue, 1 Sep 2009 06:15:59 -0700 >> From: gadb...@googlemail.com >> To: user@struts.apache.org >> Subject: Re: JS

RE: JSON plugin ignoring includeProperties parameter

2009-09-01 Thread Martin Gainty
esponsabilité pour le contenu fourni. > Date: Tue, 1 Sep 2009 06:15:59 -0700 > From: gadb...@googlemail.com > To: user@struts.apache.org > Subject: Re: JSON plugin ignoring includeProperties parameter > > > Hi, > > Sorry to jump a (dead?) thread but it's relev

Re: JSON plugin ignoring includeProperties parameter

2009-09-01 Thread Gadbury
Hi, Sorry to jump a (dead?) thread but it's relevant to what I am trying to do and it made sense to put it in the same thread. I have the following HashMap: private Map> productCategoriesMap; in my includeProperties, productCategoriesMap.* populates the json with every property of the Category

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread Dave Newton
John Cartwright wrote: Thanks for your suggestion Andras. Strangely that approach is not working for me. Ideally, I'd like to have the option of different fields included for different actions w/ in the same package. You can do that by configuring the interceptor on a per-action basis:

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread John Cartwright
Thanks for your suggestion Andras. Strangely that approach is not working for me. Ideally, I'd like to have the option of different fields included for different actions w/ in the same package. --john Andras Balogh wrote: Hi John, I had the same problem with excludeProperties, what worked

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread John Cartwright
Thanks for the suggestion Dale, but removing the whitespace does not seem to make a difference. --john Dale Newfield wrote: john.c.cartwri...@noaa.gov wrote: items.*\.name Can someone please help me w/ what might be wrong? Maybe the whitespace? Doe

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread John Cartwright
Thank you for your suggestion. However, using "features.*\.name" still does not recognize the property - it is not included in the output. Likewise, removing the annotation does not help either. --john Musachy Barroso wrote: exclude/include properties have to match the java name of the pr

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread Musachy Barroso
exclude/include properties have to match the java name of the properties, not the name in the output. Try using "features.*\.name" as the regular expression. musachy On Fri, May 22, 2009 at 10:48 AM, John Cartwright wrote: > Thanks for your reply Musachy. > > I'm using the JSON annotation to mod

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread John Cartwright
Thanks for your reply Musachy. I'm using the JSON annotation to modify the output, e.g. @JSON(name="items") public List getFeatures() { return (features); } Yes, I am getting a result. It's just that all the fields are being output rather than just the ones listed in the includeProperties.

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread Musachy Barroso
ht > dient lediglich dem Austausch von Informationen und entfaltet keine > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > > Ce message est confidentiel et peut être privilégié. Si vous n'ê

Re: JSON plugin ignoring includeProperties parameter

2009-05-22 Thread Andras Balogh
Hi John, I had the same problem with excludeProperties, what worked for me is to add the param to the interceptor-ref tag and NOT to the result: true .*Collection Best regards, Andras. john.c.cartwri...@noaa.gov wrote: Hello All, I'm trying to use jsonplugin 0.32 w/ struts 2.0.14

Re: JSON plugin ignoring includeProperties parameter

2009-05-21 Thread Musachy Barroso
There is a getItems() in your action right? Does anything get generated at all? musachy -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional

Re: JSON plugin ignoring includeProperties parameter

2009-05-21 Thread Dave Newton
Martin Gainty wrote: Here is the code private List includeProperties; includeProperties is a List of Regular Expression java.util.regex.Patterns javadoc at http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html try expressing the String as a regex Pattern e.g. [i][t][e][m][s]\p{

RE: JSON plugin ignoring includeProperties parameter

2009-05-21 Thread Martin Gainty
Here is the code private List includeProperties; includeProperties is a List of Regular Expression java.util.regex.Patterns javadoc at http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html try expressing the String as a regex Pattern e.g. [i][t][e][m][s]\p{.}\p{*}\p{\}\p{.}[n][a]

Re: JSON plugin ignoring includeProperties parameter

2009-05-21 Thread Dale Newfield
john.c.cartwri...@noaa.gov wrote: items.*\.name Can someone please help me w/ what might be wrong? Maybe the whitespace? Does it behave any differently if you do: items.*\.name ? -Dale -