Jim-
  /**
     * Generates the key to store the bean in the session with.
     */
    private void updateBeanKey() {
        if (this.sessionKey == null) {
            final StringBuffer buff = new StringBuffer();

            buff.append(this.getClass().getName()); //WHAT iS THE CLASSNAME 
doing here!
            buff.append("_");
            buff.append(this.getTargetBeanName());

            this.compiledSessionKey = buff.toString();
        }
        else {
            this.compiledSessionKey = this.sessionKey;
        }
    }

later on in getTarget
//the mucked value is set to beanKey
            String beanKey = this.compiledSessionKey;

            Object instance = session.get(beanKey);
            if (instance == null) {
                instance = this.newPrototypeInstance();
//too late now its stored in session!
                session.put(beanKey, instance);

                if (LOG.isDebugEnabled()) {
                    LOG.debug("Created instance of '" + 
this.getTargetBeanName() + "', bound to webWorkSession for '" 
                       + Thread.currentThread().getName() + "' using key '" + 
beanKey + "'.");
                }
            }
            else if (LOG.isDebugEnabled()) {
                LOG.debug("Found instance of '" + this.getTargetBeanName() + 
"', bound to webWorkSession for '" 
                       + Thread.currentThread().getName() + "' using key '" + 
beanKey + "'.");
            }

            return instance;
        }
http://www.opensymphony.com/webwork/wikidocs/Spring%20Session%20Components%20Workarounds.html

I will put this into WebWork JIRA

Good Catch!
Martin Gainty
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und 
Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 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'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> To: user@struts.apache.org
> Subject: JSON plugin class loading problem?
> From: jim_gre...@fws.gov
> Date: Tue, 19 May 2009 12:26:27 -0600
> 
> I am using version 0.32 of the JSON plugin with Struts 2.0.11.  It seems 
> to work well except for the fact that the JSON results from my struts 
> action are inconsistent.
> I have annotated my action as follows:
> 
> @Results( {
>         @Result(name = "jsonPopsResult", type = JSONResult.class, value = 
> "", params = {"root", "jsonResult", "noCache", "true"}),
>         @Result(name = "jsonRefugesResult", type = JSONResult.class, value 
> = "", params = {"root", "jsonResult", "noCache", "true"})})
> public class MapQueryAction extends ActionSupport {
> ...
> }
> 
> Sometimes the response generated by the action is (for example)
> 
>         {"trustResources":[{"displayName":"Bull Trout","id":301}]}
> 
> at other times it is
> 
>         {"jsonResult":{"trustResources":[{"displayName":"Bull 
> Trout","id":301}]}}
> 
> Note that the second response has an outer level of wrapping that 
> corresponds to the root parameter in the annotation (the action property 
> to be serialized).
> 
> I think (though am not 100% positive) that the change in behavior happens 
> when I restart my tomcat container, so this smells strongly of a class 
> loading problem.  I've looked for duplicate jars/classes, but have come up 
> empty.  In particular, I have only one json-plugin jar 
> (json-plugin-0.32.jar) in my application's WEB-INF/lib directory.  Has 
> anyone else experienced this kind of problem with the JSON plugin?
> 
> Thanks,
> Jim Greuel

_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009

Reply via email to