tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Menard <j...@io.com>
Subject Passing localized string from page to component
Date Fri, 02 Jan 2004 14:35:41 GMT
I'm trying to pass a localized string stored in a .properties file from 
the page to a component. Here's my attempt, which throws a 
NullPointerException. Any suggestions?

foo.properties:

   key1 = title text
   key2 = type text

foo.jwc:

   <component id="some_id" type="DirectLink">
     <binding name="listener" expression="listeners.myListenerMethod"/>
     <string-binding name="title" key="key1"/>
     <string-binding name="type" key="key2"/>
   </component>

foo.java:

   // I want to return "title text type text". This is called from
   // myListenerMethod. This is where the NullPointerException gets 
thrown.
   protected String theStringIWant() {
     return getBinding("title").getString() + ' '
          + getBinding("type").getString();
   }

Thank you for your help.

Jim
-- 
Jim Menard, jimm@io.com, http://www.io.com/~jimm/
"I am sure that like Java, [C#] will be a 'no pointer' language, where 
the
most common runtime error will be a 'NULL pointer exception'."
    -- Jerry Kott, in comp.lang.smalltalk


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message