3 Replies Latest reply on Nov 24, 2006 7:16 PM by peterj

    database

    justin_sane

      I want to store a String with my portlet/jboss.
      I used portletPreferences hoping, that it was that easy, but can't get anything from it.
      I just put a portletPreferences.setValue(key,something) in the processAction ant it just crashes...

      Anyone can give me a little hint?!

        • 1. Re: database
          peterj

          Were you logged in at the time? If not, your processAction code will get an exception. Being lazy, I simply catch the exception within processAction and keep on going.

          If the above does not match your situation, please post the stack trace.

          • 2. Re: database
            justin_sane

            When logged it doesn't crash, but still can't store anything in the db.
            In processAction i use prefs.setValue(key, value);
            and in doView i use prefs.getValue(key,def);
            But in doView it allways return def...

            You asked me the stack trace, but i don't have a clue how I do that...

            Thant you for your help.

            • 3. Re: database
              peterj

              After setting the preferences in processAction, you must store them:

              prefs.setValue(key, value);
              prefs.store();

              Regarding the stack trace, you stated that "it just crashes". The "crash" should have given a stack trace.