on 2/15/01 7:15 AM, "Leon Messerschmidt" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I ran into a little problem.  If I add a string to the TR.properties that
> contains "," Configurations parses it as a Vector and I get a
> ClassCastException if I call getString().
> 
> Any objects to modify getString() to so that it returns strings with ","?
> 
> I'm thinking about parsing the Vector.toString().  Something like this:
> 
> String s = value.toString();
> return s.substring (1,s.length()-1);
> 
> ~ Leon

Yea, I just noticed this as well the other day...the problem with doing that
is that there could be a case where you would want that Exception to be
thrown...therefore, write your code like this:

try
{
    return getString()
}
catch (ClassCastException cce)
{
   String s = getVector().toString();
   return s.substring (1,s.length()-1);
}

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/> && <http://java.apache.org/turbine/>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to