Solved

Vector as a configuration variable

Posted on 2003-11-13
7
262 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
  • 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
JTable - RowFilter & Columns Header. 3 136
console vs log file 16 74
TreeSet comparator example 7 87
thymeleaf natural templating vs JSP 2 24
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A procedure for exporting installed hotfix details of remote computers using powershell
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now