Vector as a configuration variable

hi all!!!
I have an application under tomcat 4.1.1.8.
I have establish my enviorement variables in the web.xml file (connection string, etc...)
I also want to establish a Vector as a configuration variable of my application, but the <env-entry> tag doesn´t support Vector class.
Any idea??
Thanks in advance.
sgomcresAsked:
Who is Participating?
 
kennethxuConnect With a Mentor Commented:
the direct answer to you question is NO, you can do Vector in env-entry. the alternative will be:
option 1. use comma separated string and parse it later in your code.
option 2. serialize you vector in a resource file and use getResourceAsStream() to load it back to you app.
0
 
jimmackCommented:
Still rummaging around for details.

In the mean time.  Do you need to fully qualify it, ie. "java.util.Vector"?
0
 
jimmackCommented:
Aha.  No, you can only have:

java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short, or java.lang.String.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
jimmackCommented:
What do you need to store in the Vector?  It sounds like you might be stretching the purpose of environment variables ;-)
0
 
sgomcresAuthor Commented:
The vector will store strings.
I am reading something about a <resource-ref> tag in web.xml...
0
 
sgomcresAuthor Commented:
I only want to store a list of strings, it doesn´t matter if the strings are store in a vector or not.
0
 
kennethxuCommented:
then, the easiest is to separate the strings with comma in one env-entry. and use StringTokenizer to read them back.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.