Solved

Vector as a configuration variable

Posted on 2003-11-13
7
267 Views
Last Modified: 2010-04-01
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.
0
Comment
Question by:sgomcres
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9740316
Still rummaging around for details.

In the mean time.  Do you need to fully qualify it, ie. "java.util.Vector"?
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9740362
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
 
LVL 15

Expert Comment

by:jimmack
ID: 9740379
What do you need to store in the Vector?  It sounds like you might be stretching the purpose of environment variables ;-)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sgomcres
ID: 9740461
The vector will store strings.
I am reading something about a <resource-ref> tag in web.xml...
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 100 total points
ID: 9740496
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
 

Author Comment

by:sgomcres
ID: 9740541
I only want to store a list of strings, it doesn´t matter if the strings are store in a vector or not.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9741179
then, the easiest is to separate the strings with comma in one env-entry. and use StringTokenizer to read them back.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question